Skip to content
Snippets Groups Projects
Commit 785213d3 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Added fetch_all_synonyms to allow lazy-loading of synonyms in DBEntry.

parent 89289606
No related branches found
No related tags found
No related merge requests found
......@@ -318,7 +318,7 @@ sub store {
$sth->bind_param(5, $dbRef,SQL_INTEGER);
$sth->bind_param(6, $exObj->info_type, SQL_VARCHAR);
$sth->bind_param(7, $exObj->info_text, SQL_VARCHAR);
$sth->bind_param(8, $exObj->xref_priority,SQL_INTEGER);
$sth->bind_param(8, 1,SQL_INTEGER); # XXX remove this!
$sth->execute();
......@@ -1149,6 +1149,41 @@ sub fetch_all_by_description {
return \@results;
}
=head2 fetch_all_synonyms
Arg [1] : dbID of DBEntry to fetch synonyms for. Used in lazy loading of synonyms.
Example : @canc_refs = @{$db_entry_adaptor->fetch_all_synonyms(1234)};
Description: Fetches the synonyms for a particular DBEntry.
Returntype : listref of synonyms. List referred to may be empty if there are no synonyms.
Exceptions : None.
Caller : General
Status : At Risk
=cut
sub fetch_all_synonyms {
my ($self, $dbID) = @_;
my @synonyms;
my $sth = $self->prepare("SELECT synonym FROM external_synonym WHERE xref_id = ?");
$sth->bind_param(1, $dbID, SQL_INTEGER);
$sth->execute();
while ( my $arrayref = $sth->fetchrow_arrayref()){
my ($synonym) = @$arrayref;
push (@synonyms, $synonym);
}
@synonyms = [] if (!@synonyms);
return \@synonyms;
}
=head2 geneids_by_extids
Description: DEPRECATED use list_gene_ids_by_extids instead
......
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