Creates a new mapped statement.
TMappedStatement
__construct
(TSqlMapManager $sqlMap, TSqlMapStatement $statement)
ResultMap with GroupBy property. Save object collection graph in a tree and collect the result later.
object result
addResultMapGroupBy
(
TResultMap $resultMap,
array $row,
object the $parent,
mixed &$resultObject)
-
TResultMap
$resultMap: result mapping details.
-
array
$row: a result set row retrieved from the database
-
object the
$parent: result object
Apply result mapping.
object the
applyResultMap
(array $row, [object the &$resultObject = null])
-
array
$row: a result set row retrieved from the database
-
object the
&$resultObject: result object, will create if necessary.
Add nested result property to post select queue.
void
enquequePostSelect
(
string $select,
TResultMap $resultMap,
TResultProperty $property,
array $row,
object the $resultObject)
-
string
$select: post select statement ID
-
TResultMap
$resultMap: current result mapping details.
-
TResultProperty
$property: current result property.
-
array
$row: a result set row retrieved from the database
-
object the
$resultObject: result object
Execute an insert statement. Fill the parameter object with the ouput parameters if any, also could return the insert generated key.
string
executeInsert
(IDbConnection $connection, mixed $parameter)
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The parameter object used to fill the statement.
Redefined in descendants as:
Process 'select' result properties
void
executePostSelect
(IDbConnection $connection)
-
IDbConnection
$connection: database connection
Executes the SQL and retuns a List of result objects.
array
executeQueryForList
(IDbConnection $connection, mixed $parameter, [object result $result = null], [integer $skip = -1], [integer $max = -1], [callback $delegate = null])
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
object result
$result: collection object.
-
integer
$skip: The number of rows to skip over.
-
integer
$max: The maximum number of rows to return.
-
callback
$delegate: row delegate handler
Redefined in descendants as:
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.
array
executeQueryForMap
(IDbConnection $connection, mixed $parameter, string $keyProperty, [string $valueProperty = null], [callback $skip = -1], [mixed $max = -1], [mixed $delegate = null])
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
string
$keyProperty: The property of the result object to be used as the key.
-
string
$valueProperty: The property of the result object to be used as the value (or null).
-
callback
$skip: row delegate handler
Redefined in descendants as:
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.
${return}
executeQueryForObject
(IDbConnection $connection, mixed $parameter, [mixed $result = null])
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The parameter data (object, arrary, primitive) used to set the parameters in the SQL
-
mixed
$result: The result object.
Redefined in descendants as:
Execute the select key statement, used to obtain last insert ID.
string
executeSelectKey
(
IDbConnection $connection,
mixed $parameter,
TSqlMapSelectKey $selectKey)
-
IDbConnection
$connection: database connection
-
mixed
$parameter: insert statement parameter
-
TSqlMapSelectKey
$selectKey: select key statement
Execute SQL Query with limits.
mixed
executeSQLQueryLimit
(IDbConnection $connection, array $command, mixed $max, mixed $skip)
-
IDbConnection
$connection: database connection
-
array
$command: SQL statement and parameters.
Execute an update statement. Also used for delete statement.
Return the number of rows effected.
integer
executeUpdate
(IDbConnection $connection, mixed $parameter)
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The object used to set the parameters in the SQL.
Redefined in descendants as:
Retrieve the result map as an array.
array
fillArrayResultMap
(
TResultMap $resultMap,
array $row,
object the $resultObject)
-
TResultMap
$resultMap: result mapping details.
-
array
$row: a result set row retrieved from the database
-
object the
$resultObject: result object
Fill the result map using default settings. If <tt>$resultMap</tt> is null the result object returned will be guessed from <tt>$resultObject</tt>.
mixed
fillDefaultResultMap
(
TResultMap $resultMap,
array $row,
object the $resultObject)
-
TResultMap
$resultMap: result mapping details.
-
array
$row: a result set row retrieved from the database
-
object the
$resultObject: result object
Fills the property with result mapping results.
boolean
fillPropertyWithResultMap
(
TResultMap $resultMap,
array $row,
object the &$resultObject)
-
TResultMap
$resultMap: nested result mapping details.
-
array
$row: a result set row retrieved from the database
-
object the
&$resultObject: result object
Apply the result to a TList or an array.
object result
fillResultArrayList
(array $row, object result $resultObject)
-
array
$row: a result set row retrieved from the database
-
object result
$resultObject: object, array or list
Fill the result using ResultClass, will creates new result object if required.
object result
fillResultClass
(string $resultClass, array $row, object the $resultObject)
-
string
$resultClass: result object class name
-
array
$row: a result set row retrieved from the database
-
object the
$resultObject: result object, will create if necessary.
Fills the result object according to result mappings.
object result
fillResultMap
(string $resultMapName, array $row, [object result $parentGroup = null], [mixed &$resultObject = null])
-
string
$resultMapName: result map name.
-
array
$row: a result set row retrieved from the database
-
object result
$parentGroup: object to fill, will create new instances if required.
Apply the result to an object.
object result
fillResultObjectProperty
(array $row, object result $resultObject)
-
array
$row: a result set row retrieved from the database
-
object result
$resultObject: object, array or list
Gets the inserted row ID after executing an insert statement.
string
getPostGeneratedSelectKey
(IDbConnection $connection, mixed $parameter)
-
IDbConnection
$connection: database connection
-
mixed
$parameter: insert statement parameter.
Finds in the post select property the SQL statement primary selection keys.
Gets the insert generated ID before executing an insert statement.
string
getPreGeneratedSelectKey
(IDbConnection $connection, mixed $parameter)
-
IDbConnection
$connection: database connection
-
mixed
$parameter: insert statement parameter.
Gets the result 'group by' groupping key for each row.
string
getResultMapGroupKey
(
TResultMap $resultMap,
array $row)
-
TResultMap
$resultMap: result mapping details.
-
array
$row: a result set row retrieved from the database
Converts the first array value to scalar value of given type.
mixed
getScalarResult
(array $result, string $type)
-
array
$result: list of results
-
string
$type: scalar type.
Empty the group by results cache.
void
initialGroupByResults
()
Raise the execute query event.
void
onExecuteQuery
(array $sql)
-
array
$sql: prepared SQL statement and subsititution parameters
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.
void
raiseRowDelegate
(object event $handler, mixed $param)
-
object event
$handler: parameter
Executes the SQL and retuns a List of result objects.
This method should only be called by internal developers, consider using <tt>executeQueryForList()</tt> first.
array
runQueryForList
(IDbConnection $connection, mixed $parameter, array $sql, object result $result, [integer $delegate = null], integer 5, callback 6)
-
integer
5: The maximum number of rows to return.
-
callback
6: row delegate handler
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
array
$sql: SQL string and subsititution parameters.
-
object result
$result: collection object.
-
integer
$delegate: The number of rows to skip over.
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 <tt>executeQueryForMap()</tt> first.
array
runQueryForMap
(IDbConnection $connection, mixed $parameter, array $command, string $keyProperty, [string $valueProperty = null], [callback $delegate = null])
-
IDbConnection
$connection: database connection
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
array
$command: SQL string and subsititution parameters.
-
string
$keyProperty: The property of the result object to be used as the key.
-
string
$valueProperty: The property of the result object to be used as the value (or null).
-
callback
$delegate: row delegate, a callback function
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 <tt>executeQueryForObject()</tt> first.
object the
runQueryForObject
(IDbConnection $connection, array $command, object The &$result)
-
IDbConnection
$connection: database connection
-
array
$command: SQL string and subsititution parameters.
-
object The
&$result: result object.
Set a property of the result object with appropriate value.
-
TResultMap
$resultMap: result mapping details.
-
TResultProperty
$property: the result property to fill.
-
array
$row: a result set row retrieved from the database
-
object the
&$resultObject: result object
Inherited Methods
Inherited From TComponent
TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()