Class TActiveRecordGateway
TActiveRecordGateway excutes the SQL command queries and returns the data record as arrays (for most finder methods).
- TComponent
-
TActiveRecordGateway
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/TActiveRecordGateway.php
public
|
|
protected
|
|
protected
string
|
#
getRecordTableName(
Gets the table name from the 'TABLE' constant of the active record class if defined, otherwise use the class name as table name. |
public
|
#
getRecordTableInfo(
Returns table information, trys the application cache first. |
public
|
#
getTableInfo(
Returns table information for table in the database connection. |
public
|
|
public
|
#
onCreateCommand(
Raised when a command is prepared and parameter binding is completed. The parameter object is TDataGatewayEventParameter of which the TDataGatewayEventParameter::getCommand Command property can be inspected to obtain the sql query to be executed. This method also raises the OnCreateCommand event on the ActiveRecord object calling this gateway. |
public
|
#
onExecuteCommand(
Raised when a command is executed and the result from the database was returned. The parameter object is TDataGatewayResultEventParameter of which the TDataGatewayEventParameter::getResult Result property contains the data return from the database. The data returned can be changed by setting the TDataGatewayEventParameter::setResult Result property. This method also raises the OnCreateCommand event on the ActiveRecord object calling this gateway. |
public
array
|
#
findRecordByPK(
Returns record data matching the given primary key(s). If the table uses composite key, specify the name value pairs as an array. |
public
array
|
#
findRecordsByPks(
Returns records matching the list of given primary keys. |
public
mixed
|
#
findRecordsByCriteria(
Returns record data matching the given critera. If $iterator is true, it will return multiple rows as TDbDataReader otherwise it returns the first row data. |
public
array
|
#
findRecordBySql(
Return record data from sql query. |
public
|
#
findRecordsBySql(
Return record data from sql query. |
public
|
|
public
integer
|
#
countRecords(
Returns the number of records that match the given criteria. |
public
integer
|
|
protected
|
#
updatePostInsert(
Sets the last insert ID to the corresponding property of the record if available. |
protected
array
|
|
public
integer
|
|
protected
|
|
protected
|
|
public
integer
|
|
protected
|
|
public
integer
|
#
deleteRecordsByPk(
Delete multiple records using primary keys. |
public
integer
|
#
deleteRecordsByCriteria(
Delete multiple records by criteria. |
protected
|
#
raiseCommandEvent( string $event,
Raise the corresponding command event, insert, update, delete or select. |
string |
TABLE_CONST |
'TABLE' |
#
Constant name for specifying optional table name in TActiveRecord. |
string |
TABLE_METHOD |
'table' |
#
Method name for returning optional table name in in TActiveRecord |
GLOBAL_RAISE_EVENT_LISTENER
|