Class \Prado\Data\SqlMap\Statements\TMappedStatement
This class is usualy instantiated during SQLMap configuration by TSqlDomBuilder.
Class hierarchy
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>Since: 3.0
public
|
__construct(TSqlMapManager $sqlMap, TSqlMapStatement $statement) : mixed
Creates a new mapped statement.
|
public
|
__sleep() : mixed
Returns an array with the names of all variables of that object that should be serialized.
Do not call this method. This is a PHP magic method that will be called automatically prior to any serialization. |
public
|
__wakeup() : mixed
The common __wakeup magic method from PHP's "unserialize".
This reattaches the behaviors to the reconstructed object. Any global class behaviors are used rather than their unserialized copy. Any global behaviors not found in the object will be added. To finalize the behaviors, dyWakeUp is raised. If a TModule needs to add events to an object during unserialization, the module can use a small IClassBehavior [implementing dyWakeUp] (adding the event[s]) attached to the class with attachClassBehavior prior to unserialization. |
public
|
executeInsert(TDbConnection $connection, mixed $parameter) : string
Execute an insert statement. Fill the parameter object with the ouput
parameters if any, also could return the insert generated key.
|
public
|
executeQueryForList(TDbConnection $connection, mixed $parameter[, null|object $result = null ][, int $skip = -1 ][, int $max = -1 ][, null|callable $delegate = null ]) : array<string|int, mixed>
Executes the SQL and retuns a List of result objects.
|
public
|
executeQueryForMap(TDbConnection $connection, mixed $parameter, string $keyProperty[, null|string $valueProperty = null ][, int $skip = -1 ][, int $max = -1 ][, null|callable $delegate = null ]) : array<string|int, mixed>
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
|
executeQueryForObject(TDbConnection $connection, mixed $parameter[, null|mixed $result = null ]) : object
Executes an SQL statement that returns a single row as an object of the
type of the <tt>$result</tt> passed in as a parameter.
|
public
|
executeUpdate(TDbConnection $connection, mixed $parameter) : int
Execute an update statement. Also used for delete statement.
Return the number of rows effected. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
runQueryForList(TDbConnection $connection, mixed $parameter, TDbCommand $sql, object $result[, null|callable $delegate = null ]) : array<string|int, mixed>
Executes the SQL and retuns a List of result objects.
This method should only be called by internal developers, consider using executeQueryForList() first. |
public
|
runQueryForMap(TDbConnection $connection, mixed $parameter, mixed $command, string $keyProperty[, null|string $valueProperty = null ][, null|callable $delegate = null ]) : array<string|int, mixed>
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. This method should only be called by internal developers, consider using executeQueryForMap() first. |
public
|
runQueryForObject(TDbConnection $connection, TDbCommand $command, object &$result) : object
Executes an SQL statement that returns a single row as an object of the
type of the <tt>$result</tt> passed in as a parameter.
This method should only be called by internal developers, consider using executeQueryForObject() first. |
protected
|
addResultMapGroupBy(TResultMap $resultMap, array<string|int, mixed> $row, mixed $parent, object &$resultObject) : object
ResultMap with GroupBy property. Save object collection graph in a tree
and collect the result later.
|
protected
|
applyResultMap(array<string|int, mixed> $row[, null|object &$resultObject = null ]) : object
Apply result mapping.
|
protected
|
enquequePostSelect(string $select, TResultMap $resultMap, TResultProperty $property, array<string|int, mixed> $row, object $resultObject) : mixed
Add nested result property to post select queue.
|
protected
|
|
protected
|
executeSelectKey(TDbConnection $connection, mixed $parameter, TSqlMapSelectKey $selectKey) : string
Execute the select key statement, used to obtain last insert ID.
|
protected
|
executeSQLQueryLimit(TDbConnection $connection, TDbCommand $command, int $max, int $skip) : mixed
Execute SQL Query with limits.
|
protected
|
fillArrayResultMap(TResultMap $resultMap, array<string|int, mixed> $row, object $resultObject) : array<string|int, mixed>
Retrieve the result map as an array.
|
protected
|
fillDefaultResultMap(TResultMap $resultMap, array<string|int, mixed> $row, object $resultObject) : mixed
Fill the result map using default settings. If <tt>$resultMap</tt> is null
the result object returned will be guessed from <tt>$resultObject</tt>.
|
protected
|
fillPropertyWithResultMap(TResultMap $resultMap, array<string|int, mixed> $row, object &$resultObject) : bool
Fills the property with result mapping results.
|
protected
|
fillResultArrayList(array<string|int, mixed> $row, object $resultObject) : object
Apply the result to a TList or an array.
|
protected
|
fillResultClass(string $resultClass, array<string|int, mixed> $row, object $resultObject) : object
Fill the result using ResultClass, will creates new result object if required.
|
protected
|
fillResultMap(string $resultMapName, array<string|int, mixed> $row[, null|mixed $parentGroup = null ][, null|object &$resultObject = null ]) : object
Fills the result object according to result mappings.
|
protected
|
fillResultObjectProperty(array<string|int, mixed> $row, object $resultObject) : object
Apply the result to an object.
|
protected
|
getPostGeneratedSelectKey(TDbConnection $connection, mixed $parameter) : null|string
Gets the inserted row ID after executing an insert statement.
|
protected
|
getPostSelectKeys(TResultMap $resultMap, TResultProperty $property, array<string|int, mixed> $row) : array<string|int, mixed>
Finds in the post select property the SQL statement primary selection keys.
|
protected
|
getPreGeneratedSelectKey(TDbConnection $connection, mixed $parameter) : null|string
Gets the insert generated ID before executing an insert statement.
|
protected
|
getResultMapGroupKey(TResultMap $resultMap, array<string|int, mixed> $row) : string
Gets the result 'group by' groupping key for each row.
|
protected
|
getScalarResult(array<string|int, mixed> $result, string $type) : mixed
Converts the first array value to scalar value of given type.
|
protected
|
|
protected
|
raiseRowDelegate(callable $handler, mixed $param) : mixed
Raises delegate handler.
This method is invoked for each new list item. It is the responsibility of the handler to add the item to the list. |
protected
|
setObjectProperty(TResultMap $resultMap, TResultProperty $property, array<string|int, mixed> $row, object &$resultObject) : mixed
Set a property of the result object with appropriate value.
|
public
int
|
QUERY_FOR_ARRAY
|
1
|
public
int
|
QUERY_FOR_LIST
|
0
|
public
int
|
QUERY_FOR_OBJECT
|
2
|
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |