OpenInteract::SPOPS::DBI - Common SPOPS::DBI-specific methods for objects


OpenInteract documentation  | view source Contained in the OpenInteract distribution.

Index


NAME

Top

OpenInteract::SPOPS::DBI - Common SPOPS::DBI-specific methods for objects

SYNOPSIS

Top

 # In configuration file
 'myobj' => {
    'isa'   => [ qw/ ... OpenInteract::SPOPS::DBI ... / ],

    # Yes, I want OI to find my fields for me.
    'field_discover' => 'yes',
 }

DESCRIPTION

Top

This class provides common datasource access methods required by SPOPS::DBI.

METHODS

Top

global_datasource_handle( [ $connect_key ] )

Returns a DBI handle corresponding to the connection key $connect_key. If $connect_key is not given, then the connection key specified for the object class is used. If the object class does not have a connection key (which is normal if you are using only one database), we use the key specified in the server configuration file in 'default_connection_db'.

global_db_handle( [ $connect_key ] )

Alias for global_datasource_handle() (kept for backward compatibility).

connection_info( [ $connect_key ] )

Returns a hashref of DBI connection information. If no $connect_key is given then we get the value of 'datasource' from the object configuration, and if that is not defined we get the default datasource from the server configuration.

See the server configuration file for documentation on what is in the hashref.

SPOPS::ClassFactory Methods

You will never need to call the following methods from your object, but you should be aware of them.

behavior_factory( $class )

Creates the 'discover_fields' behavior (see below) in the 'manipulate_configuration' slot of the SPOPS::ClassFactory process.

discover_fields( $class )

If 'field_discover' is set to 'yes' in your class configuration, this will find the fields in your database table and set the configuration value 'field' as appropriate. Pragmatically, this means you do not have to list your fields in your class configuration -- every time the server starts up the class interrogates the table for its properties.

BUGS

Top

None known.

TO DO

Top

Nothing known.

SEE ALSO

Top

SPOPS::DBI

SPOPS::ClassFactory

SPOPS::Manual::CodeGeneration (SPOPS::Manual::CodeGeneration)

COPYRIGHT

Top

AUTHORS

Top

Chris Winters <chris@cwinters.com>


OpenInteract documentation  | view source Contained in the OpenInteract distribution.