diff --git a/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm index f2e18955f39f92928ea1844b202b3a0ec07cadbc..ec66f66e75954ef2c8f5ceefd4bb2c69f783fe09 100644 --- a/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm @@ -394,6 +394,24 @@ sub fetch_all { throw("Use of method fetch_all not supported for attributes"); } +sub fetch_by_code { + my ($self, $code) = @_; + + my $sql = "SELECT attrib_type_id, code, name, description " . + "FROM attrib_type + WHERE code = '$code' "; + my $sth = $self->prepare($sql); + $sth->execute(); + + my ($attrib_type_id, $name, $desc); + $sth->bind_columns(\$attrib_type_id, \$code, \$name, \$desc); + + my @results = $sth->fetchrow_array; + $sth->finish(); + + return \@results; +} + sub fetch_all_by_Object {