Class \Prado\Data\SqlMap\TSqlMapGateway
execute an update query (including insert and delete).
execute a select query for a single object
execute a select query for a list of objects
This class should be instantiated from a TSqlMapManager instance.
Class hierarchy
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>Since: 3.1
public
|
__construct(mixed $manager) : mixed
The common __construct.
If desired by the new object, this will auto install and listen to global event functions as defined by the object via 'fx' methods. This also attaches any predefined behaviors. This function installs all class behaviors in a class hierarchy from the deepest subclass through each parent to the top most class, TComponent. |
public
|
delete(string $statementName[, mixed $parameter = null ]) : int
Executes a Sql DELETE statement. Delete returns the number of rows effected.
|
public
|
|
public
|
|
public
|
|
public
|
insert(string $statementName[, null|string $parameter = null ]) : mixed
Executes a Sql INSERT statement.
Insert is a bit different from other update methods, as it provides facilities for returning the primary key of the newly inserted row (rather than the effected rows), The parameter object is generally used to supply the input data for the INSERT values. |
public
|
queryForList(string $statementName[, null|mixed $parameter = null ][, null|TList $result = null ][, int $skip = -1 ][, int $max = -1 ]) : TList
Executes a Sql SELECT statement that returns data to populate a number
of result objects.
The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement. |
public
|
queryForMap(string $statementName[, null|mixed $parameter = null ][, null|string $keyProperty = null ][, null|string $valueProperty = null ][, int $skip = -1 ][, int $max = -1 ]) : TMap
Executes the SQL and retuns all rows selected in a map that is keyed on
the property named in the keyProperty parameter. The value at each key
will be the value of the property specified in the valueProperty
parameter. If valueProperty is null, the entire result object will be
entered.
|
public
|
queryForMapWithRowDelegate(string $statementName, callable $delegate[, null|mixed $parameter = null ][, null|string $keyProperty = null ][, null|string $valueProperty = null ][, int $skip = -1 ][, int $max = -1 ]) : TMap
Runs a query with a custom object that gets a chance to deal
with each row as it is processed.
Example: $sqlmap->queryForMapWithRowDelegate('getAccounts', array($this, 'rowHandler')); |
public
|
queryForObject(string $statementName[, mixed $parameter = null ][, mixed $result = null ]) : object
Executes a Sql SELECT statement that returns that returns data
to populate a single object instance.
The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement. |
public
|
queryForPagedList(string $statementName[, mixed $parameter = null ][, int $pageSize = 10 ][, int $page = 0 ]) : TPagedList
Executes the SQL and retuns a subset of the results in a dynamic
TPagedList that can be used to automatically scroll through results
from a database table.
|
public
|
queryForPagedListWithRowDelegate(string $statementName, callable $delegate[, null|mixed $parameter = null ][, int $pageSize = 10 ][, int $page = 0 ]) : TPagedList
Executes the SQL and retuns a subset of the results in a dynamic
TPagedList that can be used to automatically scroll through results
from a database table.
Runs paged list query with row delegate Example: $sqlmap->queryForPagedListWithRowDelegate('getAccounts', array($this, 'rowHandler')); |
public
|
queryWithRowDelegate(string $statementName, callable $delegate[, null|mixed $parameter = null ][, null|TList $result = null ][, int $skip = -1 ][, int $max = -1 ]) : TList
Runs a query for list with a custom object that gets a chance to deal
with each row as it is processed.
Example: $sqlmap->queryWithRowDelegate('getAccounts', array($this, 'rowHandler')); |
public
|
|
public
|
update(string $statementName[, mixed $parameter = null ]) : int
Executes a Sql UPDATE statement.
Update can also be used for any other update statement type, such as inserts and deletes. Update returns the number of rows effected. The parameter object is generally used to supply the input data for the UPDATE values as well as the WHERE clause parameter(s). |
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |