PHP Класс 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.
С версии: 3.1
Наследование: extends Prado\TComponent
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( $manager )
delete ( $statementName, $parameter = null ) : integer Executes a Sql DELETE statement. Delete returns the number of rows effected.
flushCaches ( ) Flushes all cached objects that belong to this SqlMap
getDbConnection ( ) : TDbConnection
getSqlMapManager ( ) : TSqlMapManager
insert ( $statementName, $parameter = null ) : mixed Executes a Sql INSERT statement.
queryForList ( $statementName, $parameter = null, $result = null, $skip, $max ) : TList Executes a Sql SELECT statement that returns data to populate a number of result objects.
queryForMap ( $statementName, $parameter = null, $keyProperty = null, $valueProperty = null, $skip, $max ) : 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.
queryForMapWithRowDelegate ( $statementName, $delegate, $parameter = null, $keyProperty = null, $valueProperty = null, $skip, $max ) : TMap Runs a query with a custom object that gets a chance to deal with each row as it is processed.
queryForObject ( $statementName, $parameter = null, $result = null ) : object Executes a Sql SELECT statement that returns that returns data to populate a single object instance.
queryForPagedList ( $statementName, $parameter = null, $pageSize = 10, $page ) : 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.
queryForPagedListWithRowDelegate ( $statementName, $delegate, $parameter = null, $pageSize = 10, $page ) : 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.
queryWithRowDelegate ( $statementName, $delegate, $parameter = null, $result = null, $skip, $max ) : TList Runs a query for list with a custom object that gets a chance to deal with each row as it is processed.
registerTypeHandler ( $typeHandler )
update ( $statementName, $parameter = null ) : integer Executes a Sql UPDATE statement.

Описание методов

__construct() публичный Метод

public __construct ( $manager )

delete() публичный Метод

Executes a Sql DELETE statement. Delete returns the number of rows effected.
public delete ( $statementName, $parameter = null ) : integer
Результат integer The number of rows effected.

flushCaches() публичный Метод

Flushes all cached objects that belong to this SqlMap
public flushCaches ( )

getDbConnection() публичный Метод

public getDbConnection ( ) : TDbConnection
Результат TDbConnection database connection.

getSqlMapManager() публичный Метод

public getSqlMapManager ( ) : TSqlMapManager
Результат TSqlMapManager sqlmap manager.

insert() публичный Метод

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 insert ( $statementName, $parameter = null ) : mixed
Результат mixed The primary key of the newly inserted row. This might be automatically generated by the RDBMS, or selected from a sequence table or other source.

queryForList() публичный Метод

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.
public queryForList ( $statementName, $parameter = null, $result = null, $skip, $max ) : TList
Результат TList A List of result objects.

queryForMap() публичный Метод

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 queryForMap ( $statementName, $parameter = null, $keyProperty = null, $valueProperty = null, $skip, $max ) : TMap
Результат TMap Array object containing the rows keyed by keyProperty.

queryForMapWithRowDelegate() публичный Метод

Example: $sqlmap->queryForMapWithRowDelegate('getAccounts', array($this, 'rowHandler'));
public queryForMapWithRowDelegate ( $statementName, $delegate, $parameter = null, $keyProperty = null, $valueProperty = null, $skip, $max ) : TMap
Результат TMap Array object containing the rows keyed by keyProperty.

queryForObject() публичный Метод

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.
public queryForObject ( $statementName, $parameter = null, $result = null ) : object
Результат object A single result object populated with the result set data.

queryForPagedList() публичный Метод

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 queryForPagedList ( $statementName, $parameter = null, $pageSize = 10, $page ) : TPagedList
Результат TPagedList A PaginatedList of beans containing the rows.

queryForPagedListWithRowDelegate() публичный Метод

Runs paged list query with row delegate Example: $sqlmap->queryForPagedListWithRowDelegate('getAccounts', array($this, 'rowHandler'));
public queryForPagedListWithRowDelegate ( $statementName, $delegate, $parameter = null, $pageSize = 10, $page ) : TPagedList
Результат TPagedList A PaginatedList of beans containing the rows.

queryWithRowDelegate() публичный Метод

Example: $sqlmap->queryWithRowDelegate('getAccounts', array($this, 'rowHandler'));
public queryWithRowDelegate ( $statementName, $delegate, $parameter = null, $result = null, $skip, $max ) : TList
Результат TList A List of result objects.

registerTypeHandler() публичный Метод

public registerTypeHandler ( $typeHandler )

update() публичный Метод

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).
public update ( $statementName, $parameter = null ) : integer
Результат integer The number of rows effected.