Bio::EnsEMBL::ExternalData BaseAdaptor
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::DBSQL::BaseAdaptor - Base Adaptor for DBSQL adaptors
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Root
Inherit
Bio::EnsEMBL::Root
Synopsis
    # base adaptor provides

# SQL prepare function
$adaptor->prepare("sql statement");
# get of root db object $adaptor->db(); # delete memory cycles $adaptor->deleteObj(); # constructor, ok for inheritence $adaptor = Bio::EnsEMBL::DBSQL::ClassWhichInheritsFromBaseAdaptor->new($dbobj)
Description
This is a true base class for Adaptors in the Ensembl DBSQL
system. Original idea from Arne
Methods
dbDescriptionCode
deleteObjDescriptionCode
new
No description
Code
prepareDescriptionCode
Methods description
dbcode    nextTop
 Title   : db
Usage : $obj->db($newval)
Function:
Returns : value of db
Args : newvalue (optional)
deleteObjcodeprevnextTop
 Title   : deleteObj
Usage : $obj->deleteObj
Function: removes memory cycles. Probably triggered by Root deleteObj
Returns :
Args : none
preparecodeprevnextTop
 Title   : prepare
Usage : $sth = $adaptor->prepare("select yadda from blabla")
Function: provides a DBI statement handle from the adaptor. A convience
function so you dont have to write $adaptor->db->prepare all the
time
Example :
Returns :
Args :
Methods code
dbdescriptionprevnextTop
sub db {
   my $obj = shift;
   if( @_ ) {
      my $value = shift;
      $obj->{'db'} = $value;
    }
    return $obj->{'db'};
}
deleteObjdescriptionprevnextTop
sub deleteObj {
  my $self = shift;
  my @dummy = values %{$self};
  foreach my $key ( keys %$self ) {
    delete $self->{$key};
  }
  foreach my $obj ( @dummy ) {
    eval {
      $obj->deleteObj;
    }
  }
}
newdescriptionprevnextTop
sub new {
    my ($class,$dbobj) = @_;

    my $self = {};
    bless $self,$class;

    if( !defined $dbobj || !ref $dbobj ) {
	$self->throw("Don't have a db [$dbobj] for new adaptor");
    }

    $self->db($dbobj);

    return $self;
}
preparedescriptionprevnextTop
sub prepare {
   my ($self,$string) = @_;

   return $self->db->prepare($string);
}
General documentation
CONTACTTop
Describe contact details here
APPENDIXTop
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _