OpenInteract::SPOPS::DBI - Common SPOPS::DBI-specific methods for objects
# In configuration file 'myobj' => { 'isa' => [ qw/ ... OpenInteract::SPOPS::DBI ... / ], # Yes, I want OI to find my fields for me. 'field_discover' => 'yes', }
This class provides common datasource access methods required by SPOPS::DBI.
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'.
$connect_key
global_db_handle( [ $connect_key ] )
Alias for global_datasource_handle() (kept for backward compatibility).
global_datasource_handle()
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.
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.
None known.
Nothing known.
SPOPS::DBI
SPOPS::ClassFactory
SPOPS::Manual::CodeGeneration
Copyright (c) 2001-2002 intes.net, inc.. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Chris Winters <chris@cwinters.com>
To install OpenInteract, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenInteract
CPAN shell
perl -MCPAN -e shell install OpenInteract
For more information on module installation, please visit the detailed CPAN module installation guide.