PHP Класс Prado\Data\SqlMap\Statements\TMappedStatement

This class is usualy instantiated during SQLMap configuration by TSqlDomBuilder.
С версии: 3.0
Наследование: extends Prado\TComponent, implements Prado\Data\SqlMap\Statements\IMappedStatement
Показать файл Открыть проект

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

Метод Описание
__construct ( TSqlMapManager $sqlMap, TSqlMapStatement $statement ) Creates a new mapped statement.
__sleep ( )
__wakeup ( )
executeInsert ( $connection, $parameter ) : string Execute an insert statement. Fill the parameter object with the ouput parameters if any, also could return the insert generated key.
executeQueryForList ( $connection, $parameter, $result = null, $skip, $max, $delegate = null ) : array Executes the SQL and retuns a List of result objects.
executeQueryForMap ( $connection, $parameter, $keyProperty, $valueProperty = null, $skip, $max, $delegate = null ) : array 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.
executeQueryForObject ( $connection, $parameter, $result = null ) Executes an SQL statement that returns a single row as an object of the type of the $result passed in as a parameter.
executeUpdate ( $connection, $parameter ) : integer Execute an update statement. Also used for delete statement.
getCommand ( ) : TPreparedCommand
getID ( ) : string
getManager ( ) : TSqlMapper
getSqlString ( )
getStatement ( ) : TSqlMapStatement
onExecuteQuery ( $sql ) Raise the execute query event.
runQueryForList ( $connection, $parameter, $sql, $result, $delegate = null ) : array Executes the SQL and retuns a List of result objects.
runQueryForMap ( $connection, $parameter, $command, $keyProperty, $valueProperty = null, $delegate = null ) : array 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.
runQueryForObject ( $connection, $command, &$result ) : object Executes an SQL statement that returns a single row as an object of the type of the $result passed in as a parameter.

Защищенные методы

Метод Описание
addResultMapGroupBy ( $resultMap, $row, $parent, &$resultObject ) : object ResultMap with GroupBy property. Save object collection graph in a tree and collect the result later.
applyResultMap ( $row, &$resultObject = null ) : object Apply result mapping.
enquequePostSelect ( $select, $resultMap, $property, $row, $resultObject ) Add nested result property to post select queue.
executePostSelect ( $connection ) Process 'select' result properties
executeSQLQueryLimit ( $connection, $command, $max, $skip ) : mixed Execute SQL Query with limits.
executeSelectKey ( $connection, $parameter, $selectKey ) : string Execute the select key statement, used to obtain last insert ID.
fillArrayResultMap ( $resultMap, $row, $resultObject ) : array Retrieve the result map as an array.
fillDefaultResultMap ( $resultMap, $row, $resultObject ) : mixed Fill the result map using default settings. If $resultMap is null the result object returned will be guessed from $resultObject.
fillPropertyWithResultMap ( $resultMap, $row, &$resultObject ) : boolean Fills the property with result mapping results.
fillResultArrayList ( $row, $resultObject ) : object Apply the result to a TList or an array.
fillResultClass ( $resultClass, $row, $resultObject ) : object Fill the result using ResultClass, will creates new result object if required.
fillResultMap ( $resultMapName, $row, $parentGroup = null, &$resultObject = null ) : object Fills the result object according to result mappings.
fillResultObjectProperty ( $row, $resultObject ) : object Apply the result to an object.
getPostGeneratedSelectKey ( $connection, $parameter ) : string Gets the inserted row ID after executing an insert statement.
getPostSelectKeys ( $resultMap, $property, $row ) : array Finds in the post select property the SQL statement primary selection keys.
getPreGeneratedSelectKey ( $connection, $parameter ) : string Gets the insert generated ID before executing an insert statement.
getResultMapGroupKey ( $resultMap, $row ) : string Gets the result 'group by' groupping key for each row.
getScalarResult ( $result, $type ) : mixed Converts the first array value to scalar value of given type.
initialGroupByResults ( ) Empty the group by results cache.
raiseRowDelegate ( $handler, $param ) Raises delegate handler.
setObjectProperty ( $resultMap, $property, $row, &$resultObject ) Set a property of the result object with appropriate value.

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

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

Creates a new mapped statement.
public __construct ( TSqlMapManager $sqlMap, TSqlMapStatement $statement )
$sqlMap Prado\Data\SqlMap\TSqlMapManager
$statement Prado\Data\SqlMap\Configuration\TSqlMapStatement

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

public __sleep ( )

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

public __wakeup ( )

addResultMapGroupBy() защищенный Метод

ResultMap with GroupBy property. Save object collection graph in a tree and collect the result later.
protected addResultMapGroupBy ( $resultMap, $row, $parent, &$resultObject ) : object
Результат object result object.

applyResultMap() защищенный Метод

Apply result mapping.
protected applyResultMap ( $row, &$resultObject = null ) : object
Результат object the result filled with data, null if not filled.

enquequePostSelect() защищенный Метод

Add nested result property to post select queue.
protected enquequePostSelect ( $select, $resultMap, $property, $row, $resultObject )

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

Execute an insert statement. Fill the parameter object with the ouput parameters if any, also could return the insert generated key.
public executeInsert ( $connection, $parameter ) : string
Результат string the insert generated key.

executePostSelect() защищенный Метод

Process 'select' result properties
protected executePostSelect ( $connection )

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

Executes the SQL and retuns a List of result objects.
См. также: executeQueryForList()
public executeQueryForList ( $connection, $parameter, $result = null, $skip, $max, $delegate = null ) : array
Результат array a list of result objects

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

If valueProperty is null, the entire result object will be entered.
public executeQueryForMap ( $connection, $parameter, $keyProperty, $valueProperty = null, $skip, $max, $delegate = null ) : array
Результат array An array of object containing the rows keyed by keyProperty.

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

Executes an SQL statement that returns a single row as an object of the type of the $result passed in as a parameter.
public executeQueryForObject ( $connection, $parameter, $result = null )

executeSQLQueryLimit() защищенный Метод

Execute SQL Query with limits.
protected executeSQLQueryLimit ( $connection, $command, $max, $skip ) : mixed
Результат mixed record set if applicable.

executeSelectKey() защищенный Метод

Execute the select key statement, used to obtain last insert ID.
protected executeSelectKey ( $connection, $parameter, $selectKey ) : string
Результат string last insert ID.

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

Return the number of rows effected.
public executeUpdate ( $connection, $parameter ) : integer
Результат integer The number of rows effected.

fillArrayResultMap() защищенный Метод

Retrieve the result map as an array.
protected fillArrayResultMap ( $resultMap, $row, $resultObject ) : array
Результат array array list of result objects.

fillDefaultResultMap() защищенный Метод

Fill the result map using default settings. If $resultMap is null the result object returned will be guessed from $resultObject.
protected fillDefaultResultMap ( $resultMap, $row, $resultObject ) : mixed
Результат mixed the result object filled with data.

fillPropertyWithResultMap() защищенный Метод

Fills the property with result mapping results.
protected fillPropertyWithResultMap ( $resultMap, $row, &$resultObject ) : boolean
Результат boolean true if the data was found, false otherwise.

fillResultArrayList() защищенный Метод

Apply the result to a TList or an array.
protected fillResultArrayList ( $row, $resultObject ) : object
Результат object result filled with data.

fillResultClass() защищенный Метод

Fill the result using ResultClass, will creates new result object if required.
protected fillResultClass ( $resultClass, $row, $resultObject ) : object
Результат object result object filled with data

fillResultMap() защищенный Метод

Fills the result object according to result mappings.
protected fillResultMap ( $resultMapName, $row, $parentGroup = null, &$resultObject = null ) : object
Результат object result object filled with data.

fillResultObjectProperty() защищенный Метод

Apply the result to an object.
protected fillResultObjectProperty ( $row, $resultObject ) : object
Результат object result filled with data.

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

public getCommand ( ) : TPreparedCommand
Результат TPreparedCommand command to prepare SQL statements.

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

public getID ( ) : string
Результат string Name used to identify the TMappedStatement amongst the others. This the name of the SQL statement by default.

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

public getManager ( ) : TSqlMapper
Результат TSqlMapper The SqlMap used by this MappedStatement

getPostGeneratedSelectKey() защищенный Метод

Gets the inserted row ID after executing an insert statement.
protected getPostGeneratedSelectKey ( $connection, $parameter ) : string
Результат string last insert ID, null otherwise.

getPostSelectKeys() защищенный Метод

Finds in the post select property the SQL statement primary selection keys.
protected getPostSelectKeys ( $resultMap, $property, $row ) : array
Результат array list of primary key values.

getPreGeneratedSelectKey() защищенный Метод

Gets the insert generated ID before executing an insert statement.
protected getPreGeneratedSelectKey ( $connection, $parameter ) : string
Результат string new insert ID if pre-select key statement was executed, null otherwise.

getResultMapGroupKey() защищенный Метод

Gets the result 'group by' groupping key for each row.
protected getResultMapGroupKey ( $resultMap, $row ) : string
Результат string groupping key.

getScalarResult() защищенный Метод

Converts the first array value to scalar value of given type.
protected getScalarResult ( $result, $type ) : mixed
Результат mixed scalar value.

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

public getSqlString ( )

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

public getStatement ( ) : TSqlMapStatement
Результат Prado\Data\SqlMap\Configuration\TSqlMapStatement The SQL statment used by this MappedStatement

initialGroupByResults() защищенный Метод

Empty the group by results cache.
protected initialGroupByResults ( )

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

Raise the execute query event.
public onExecuteQuery ( $sql )

raiseRowDelegate() защищенный Метод

This method is invoked for each new list item. It is the responsibility of the handler to add the item to the list.
protected raiseRowDelegate ( $handler, $param )

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

This method should only be called by internal developers, consider using executeQueryForList() first.
См. также: executeQueryForList()
public runQueryForList ( $connection, $parameter, $sql, $result, $delegate = null ) : array
Результат array a list of result objects

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

If valueProperty is null, the entire result object will be entered. This method should only be called by internal developers, consider using executeQueryForMap() first.
См. также: executeQueryForMap()
public runQueryForMap ( $connection, $parameter, $command, $keyProperty, $valueProperty = null, $delegate = null ) : array
Результат array An array of object containing the rows keyed by keyProperty.

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

This method should only be called by internal developers, consider using executeQueryForObject() first.
См. также: executeQueryForObject()
public runQueryForObject ( $connection, $command, &$result ) : object
Результат object the object.

setObjectProperty() защищенный Метод

Set a property of the result object with appropriate value.
protected setObjectProperty ( $resultMap, $property, $row, &$resultObject )