- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TActiveRecord
TActiveRecordChangeEventParameter
TActiveRecordConfig
TActiveRecordConfigurationException
TActiveRecordCriteria
TActiveRecordException
TActiveRecordGateway
TActiveRecordInvalidFinderResult
TActiveRecordManager

Keyword

# Class TActiveRecordConfig

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

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
Author: Wei Zhuo <weizho[at]gmail[dot]com>

Method Summary
boolean | getEnableCache ()
TActiveRecordInvalidFinderResult | getInvalidFinderResult ()
void | init ( TXmlDocument $xml) Initialize the active record manager.
void | setEnableCache ( boolean $value) Set true to cache the table meta data.
void | setInvalidFinderResult ( TActiveRecordInvalidFinderResult $value) Define the way an active record finder react if an invalid magic-finder invoked

Methods Inherited From TDataSourceConfig
TDataSourceConfig::findConnectionByID(), TDataSourceConfig::getConnectionClass(), TDataSourceConfig::getConnectionID(), TDataSourceConfig::getDatabase(), TDataSourceConfig::getDbConnection(), TDataSourceConfig::init(), TDataSourceConfig::setConnectionClass(), TDataSourceConfig::setConnectionID()

Methods Inherited From TModule
TModule::getID(), TModule::init(), TModule::setID()

Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()

Methods 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()

Method Details

## getEnableCache

public boolean getEnableCache | ()

Output
boolean | true if table meta data should be cached, false otherwise.
Exception

## getInvalidFinderResult

public TActiveRecordInvalidFinderResult getInvalidFinderResult | ()

Output
TActiveRecordInvalidFinderResult | Defaults to 'Null'.
Exception

## init

public void init | (TXmlDocument $xml )

Initialize the active record manager.

Input
TXmlDocument | $xml | xml configuration.
Output
Exception

## setEnableCache

public void setEnableCache | (boolean $value )

Set true to cache the table meta data.

Input
boolean | $value | true to cache sqlmap instance.
Output
Exception

## setInvalidFinderResult

public void setInvalidFinderResult | (TActiveRecordInvalidFinderResult $value )

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

Input
TActiveRecordInvalidFinderResult | $value |
Output
Exception