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
-
TApplicationComponent
-
TModule implements IModule
-
TDataSourceConfig
-
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
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
public
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
boolean
|
|
public
|
|
public
|
#
setInvalidFinderResult(
Define the way an active record finder react if an invalid magic-finder invoked |
findConnectionByID(),
getConnectionClass(),
getConnectionID(),
getDatabase(),
getDbConnection(),
setConnectionClass(),
setConnectionID()
|
getID(),
setID()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
string |
DEFAULT_MANAGER_CLASS |
'System.Data.ActiveRecord.TActiveRecordManager' |
|
string |
DEFAULT_GATEWAY_CLASS |
'System.Data.ActiveRecord.TActiveRecordGateway' |
GLOBAL_RAISE_EVENT_LISTENER
|