## Class TActiveRecordConfig

Description

TActiveRecordConfig module configuration class.

Database configuration for the default ActiveRecord manager instance.

Example: application.xml configuration

     <modules>
         <module class="System.Data.ActiveRecord.TActiveRecordConfig" EnableCache="true">
             <database ConnectionString="mysql:host=localhost;dbname=test"
                 Username="dbuser" Password="dbpass" />
         </module>
     </modules>

MySQL database definition:

     CREATE TABLE `blogs` (
      `blog_id` int(10) unsigned NOT NULL auto_increment,
      `blog_name` varchar(255) NOT NULL,
      `blog_author` varchar(255) NOT NULL,
      PRIMARY KEY  (`blog_id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Record php class:

     class Blogs extends TActiveRecord
     {
         public $blog_id;
        public $blog_name;
        public $blog_author;

        public static function finder($className=__CLASS__)
        {
            return parent::finder($className);
        }
     }

Usage example:

     class Home extends TPage
     {
         function onLoad($param)
         {
             $blogs = Blogs::finder()->findAll();
          print_r($blogs);
         }
     }

- since: 3.1
- version: $Id: TActiveRecordConfig.php 2648 2009-05-10 10:51:52Z godzilla80@gmx.net $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/ActiveRecord/TActiveRecordConfig.php (line 73)

    TComponent
       |
       --TApplicationComponent
          |
          --TModule
             |
             --TDataSourceConfig
                |
                --TActiveRecordConfig

Method Summary
boolean getEnableCache ()
TActiveRecordInvalidFinderResult getInvalidFinderResult ()
void init (TXmlDocument $xml)
void setEnableCache (boolean $value)
void setInvalidFinderResult (TActiveRecordInvalidFinderResult $value)
Methods
getEnableCache (line 111)

- return: true if table meta data should be cached, false otherwise.
- access: public

boolean getEnableCache ()
getInvalidFinderResult (line 121)

- return: Defaults to 'Null'.
- access: public
- since: 3.1.5
- see: TActiveRecordConfig::setInvalidFinderResult()

TActiveRecordInvalidFinderResult getInvalidFinderResult ()
init (line 89)

Initialize the active record manager.

- access: public

void init (TXmlDocument $xml)

- TXmlDocument $xml: xml configuration.

Redefinition of:

TDataSourceConfig::init()
  Initalize the database connection properties from attributes in <database> tag.

setEnableCache (line 103)

Set true to cache the table meta data.

- access: public

void setEnableCache (boolean $value)

- boolean $value: true to cache sqlmap instance.

setInvalidFinderResult (line 133)

Define the way an active record finder react if an invalid magic-finder invoked

- access: public
- since: 3.1.5
- see: TActiveRecordConfig::getInvalidFinderResult()

void setInvalidFinderResult (TActiveRecordInvalidFinderResult $value)

- TActiveRecordInvalidFinderResult $value

#### Inherited Methods

Inherited From TDataSourceConfig

> TDataSourceConfig::findConnectionByID()
> TDataSourceConfig::getConnectionClass()
> TDataSourceConfig::getConnectionID()
> TDataSourceConfig::getDatabase()
> TDataSourceConfig::getDbConnection()
> TDataSourceConfig::init()
> TDataSourceConfig::setConnectionClass()
> TDataSourceConfig::setConnectionID()

Inherited From TModule

> TModule::getID()
> TModule::init()
> TModule::setID()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Mon, 22 Feb 2010 12:16:32 +0000 by phpDocumentor 1.3.0RC4