|
Interface IMappedStatement
Interface for all mapping statements.
Package: System\ Data\ SqlMap\ Statements
Author:
Wei Zhuo <weizho[at]gmail[dot]com>
Since:
3.1
Located at Data/SqlMap/Statements/IMappedStatement.php
Methods summary
public
string
|
#
getID( )
Returns
string Name used to identify the MappedStatement amongst the others.
|
public
TSqlMapStatement
|
|
public
TSqlMap
|
#
getManager( )
Returns
TSqlMap The TSqlMap used by this TMappedStatement
|
public
TMap
|
#
executeQueryForMap( IDbConnection $connection, mixed $parameter, string $keyProperty, string $valueProperty = null )
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.
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.
Parameters
- $connection
IDbConnection database connection to execute the query
- $parameter
mixed The object used to set the parameters in the SQL.
- $keyProperty
string The property of the result object to be used as the key.
- $valueProperty
string The property of the result object to be used as the value (or null)
Returns
TMap
A map of object containing the rows keyed by $keyProperty.
|
public
integer
|
#
executeUpdate( IDbConnection $connection, mixed $parameter )
Execute an update statement. Also used for delete statement. Return the
number of row effected.
Execute an update statement. Also used for delete statement. Return the
number of row effected.
Parameters
- $connection
IDbConnection database connection to execute the query
- $parameter
mixed The object used to set the parameters in the SQL.
Returns
integer The number of row effected.
|
public
TList
|
#
executeQueryForList( IDbConnection $connection, mixed $parameter, TList $result = null, integer $skip = -1, integer $max = -1 )
Executes the SQL and retuns a subset of the rows selected.
Executes the SQL and retuns a subset of the rows selected.
Parameters
- $connection
IDbConnection database connection to execute the query
- $parameter
mixed The object used to set the parameters in the SQL.
- $result
TList
A list to populate the result with.
- $skip
integer The number of rows to skip over.
- $max
integer The maximum number of rows to return.
Returns
TList
A TList of result objects.
|
public
object
|
#
executeQueryForObject( IDbConnection $connection, mixed $parameter, object $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.
Executes an SQL statement that returns a single row as an object of the type
of the $result passed in as a parameter.
Parameters
- $connection
IDbConnection database connection to execute the query
- $parameter
mixed The object used to set the parameters in the SQL.
- $result
object The result object.
Returns
object result.
|
|