PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class 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);
        }
}
TComponent
Extended by TApplicationComponent
Extended by TModule implements IModule
Extended by TDataSourceConfig
Extended by TActiveRecordConfig
Package: System\Data\ActiveRecord
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizho[at]gmail[dot]com>
Since: 3.1
Located at Data/ActiveRecord/TActiveRecordConfig.php
Methods summary
public
# init( TXmlDocument $xml )

Initialize the active record manager.

Initialize the active record manager.

Parameters

$xml
TXmlDocument
xml configuration.

Overrides

TDataSourceConfig::init()
public TActiveRecordManager
# getManager( )

Returns

TActiveRecordManager
public
# setManagerClass( string $value )

Set implementation class of ActiveRecordManager

Set implementation class of ActiveRecordManager

Parameters

$value
string
$value
public string
# getManagerClass( )

Returns

string
the implementation class of ActiveRecordManager. Defaults to TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_MANAGER_CLASS
public
# setGatewayClass( string $value )

Set implementation class of ActiveRecordGateway

Set implementation class of ActiveRecordGateway

Parameters

$value
string
$value
public string
# getGatewayClass( )

Returns

string
the implementation class of ActiveRecordGateway. Defaults to TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS
public
# setEnableCache( boolean $value )

Set true to cache the table meta data.

Set true to cache the table meta data.

Parameters

$value
boolean
true to cache sqlmap instance.
public boolean
# getEnableCache( )

Returns

boolean
true if table meta data should be cached, false otherwise.
public TActiveRecordInvalidFinderResult
# getInvalidFinderResult( )

Returns

TActiveRecordInvalidFinderResult
Defaults to 'TActiveRecordInvalidFinderResult::Null Null'.

Since

3.1.5

See

TActiveRecordConfig::setInvalidFinderResult()
public
# setInvalidFinderResult( TActiveRecordInvalidFinderResult $value )

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

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

Parameters

$value
TActiveRecordInvalidFinderResult

Since

3.1.5

See

TActiveRecordConfig::getInvalidFinderResult()
Methods inherited from TDataSourceConfig
findConnectionByID(), getConnectionClass(), getConnectionID(), getDatabase(), getDbConnection(), setConnectionClass(), setConnectionID()
Methods inherited from TModule
getID(), setID()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __construct(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants summary
string DEFAULT_MANAGER_CLASS 'System.Data.ActiveRecord.TActiveRecordManager'
#
string DEFAULT_GATEWAY_CLASS 'System.Data.ActiveRecord.TActiveRecordGateway'
#
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO