PHP 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.
Since: 3.1
Inheritance: extends Prado\TComponent
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

public __construct ( $manager )

delete() public méthode

Executes a Sql DELETE statement. Delete returns the number of rows effected.
public delete ( $statementName, $parameter = null ) : integer
Résultat integer The number of rows effected.

flushCaches() public méthode

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

getDbConnection() public méthode

public getDbConnection ( ) : TDbConnection
Résultat TDbConnection database connection.

getSqlMapManager() public méthode

public getSqlMapManager ( ) : TSqlMapManager
Résultat TSqlMapManager sqlmap manager.

insert() public méthode

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
Résultat 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() public méthode

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
Résultat TList A List of result objects.

queryForMap() public méthode

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
Résultat TMap Array object containing the rows keyed by keyProperty.

queryForMapWithRowDelegate() public méthode

Example: $sqlmap->queryForMapWithRowDelegate('getAccounts', array($this, 'rowHandler'));
public queryForMapWithRowDelegate ( $statementName, $delegate, $parameter = null, $keyProperty = null, $valueProperty = null, $skip, $max ) : TMap
Résultat TMap Array object containing the rows keyed by keyProperty.

queryForObject() public méthode

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
Résultat object A single result object populated with the result set data.

queryForPagedList() public méthode

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
Résultat TPagedList A PaginatedList of beans containing the rows.

queryForPagedListWithRowDelegate() public méthode

Runs paged list query with row delegate Example: $sqlmap->queryForPagedListWithRowDelegate('getAccounts', array($this, 'rowHandler'));
public queryForPagedListWithRowDelegate ( $statementName, $delegate, $parameter = null, $pageSize = 10, $page ) : TPagedList
Résultat TPagedList A PaginatedList of beans containing the rows.

queryWithRowDelegate() public méthode

Example: $sqlmap->queryWithRowDelegate('getAccounts', array($this, 'rowHandler'));
public queryWithRowDelegate ( $statementName, $delegate, $parameter = null, $result = null, $skip, $max ) : TList
Résultat TList A List of result objects.

registerTypeHandler() public méthode

public registerTypeHandler ( $typeHandler )

update() public méthode

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
Résultat integer The number of rows effected.