Bio-Genex
view release on metacpan or search on metacpan
Contact/Contact.pm view on Meta::CPAN
# retrieving the primary key for an object, generically
my $primary_key = $Contact->id();
# or specifically
my $con_pk_val = $Contact->con_pk();
# retreving other DB column attributes
my $type_val = $Contact->type();
$Contact->type($value);
my $organization_val = $Contact->organization();
$Contact->organization($value);
my $contact_person_val = $Contact->contact_person();
$Contact->contact_person($value);
my $contact_person_phone_val = $Contact->contact_person_phone();
$Contact->contact_person_phone($value);
my $contact_person_email_val = $Contact->contact_person_email();
$Contact->contact_person_email($value);
my $org_phone_val = $Contact->org_phone();
$Contact->org_phone($value);
my $org_email_val = $Contact->org_email();
$Contact->org_email($value);
my $org_mail_address_val = $Contact->org_mail_address();
$Contact->org_mail_address($value);
my $org_toll_free_phone_val = $Contact->org_toll_free_phone();
$Contact->org_toll_free_phone($value);
my $org_fax_val = $Contact->org_fax();
$Contact->org_fax($value);
my $url_val = $Contact->url();
$Contact->url($value);
my $last_updated_val = $Contact->last_updated();
$Contact->last_updated($value);
=head1 DESCRIPTION
Each Genex class has a one to one correspondence with a GeneX DB table
of the same name (I<i.e.> the corresponding table for Bio::Genex::Contact is
Contact).
Most applications will first create an instance of Bio::Genex::Contact
and then fetch the data for the object from the DB by invoking
C<fetch()>. However, in cases where you may only be accessing a single
value from an object the built-in L<delayed fetch|/DELAYED_FETCH>
mechanism can be used. All objects are created without pre-fetching
any data from the DB. Whenever an attribute of the object is accessed
via a getter method, the data for that attribute will be fetched from
the DB if it has not already been. Delayed fetching happens
transparently without the user needing to enable or disable any
features.
Since data is not be fetched from the DB I<until> it is accessed by
the calling application, it could presumably save a lot of access time
for large complicated objects when only a few attribute values are
needed.
=head1 ATTRIBUTES
There are three different types of attributes which instances of
Bio::Genex::Contact can access: I<raw> foreign key attributes,
Obect-Oriented foreign key attributes, and simple column attributes.
=over 4
=item Raw Foreign Keys Attributes
=item Object Oriented Foreign Key Attributes
This mode presents foreign key attributes in a special way, with all
non-foreign key attributes presented normally. Foreign keys are first
retrieved from the DB, and then objects of the appropriate classes are
created and stored in slots. This mode is useful for applications that
want to process information from the DB because it automates looking
up information.
Specifying the 'C<recursive_fetch>' parameter when calling C<new()>,
modifies the behavior of this mode. The value given specifies the
number of levels deep that fetch will be invoked on sub-objects
created.
=item Simple Column Attributes
=back
=head1 CLASS VARIABLES
Class Bio::Genex::Contact defines the following utility variables for assisting
programmers to access the Contact table.
=over 4
=item $Bio::Genex::Contact::LIMIT
If defined, $LIMIT will set a limit on any select statements that can
return multiple instances of this class (for example C<get_objects()>
or any call to a C<ONE_TO_MANY> or C<LOOKUP_TABLE> foreign key
accessor method).
=item $Bio::Genex::Contact::USE_CACHE
This variable controls whether the class will cache any objects
created in calls to C<new()>. Objects are cached by primary key. The
caching is very simple, and no effort is made to track whether
different invocations of C<new()> are being made for an object with
the same primary key value, but with different options set. If you
desire to reinstantiate an object with a different set of parameters,
( run in 0.541 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )