Commit ca188a21 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Be more straight-forward.

parent e2a0c596
......@@ -1542,24 +1542,27 @@ sub fetch_all_by_source {
sub fetch_all_synonyms {
my ( $self, $dbID ) = @_;
my ($self, $dbID) = @_;
my @synonyms = ();
my @synonyms;
my $sth =
$self->prepare( "SELECT synonym "
. "FROM external_synonym "
. "WHERE xref_id = ?" );
my $sth = $self->prepare("SELECT synonym FROM external_synonym WHERE xref_id = ?");
$sth->bind_param( 1, $dbID, SQL_INTEGER );
$sth->bind_param(1, $dbID, SQL_INTEGER);
$sth->execute();
while ( my $arrayref = $sth->fetchrow_arrayref()){
my ($synonym) = @$arrayref;
push (@synonyms, $synonym);
}
@synonyms = () if (!@synonyms);
my $synonym;
$sth->bind_col(1, \$synonym);
return \@synonyms;
while ( $sth->fetch() ) {
push( @synonyms, $synonym );
}
return \@synonyms;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment