TSqlMapGateway
__construct
(mixed $manager)
Executes a Sql DELETE statement. Delete returns the number of rows effected.
integer
delete
(string $statementName, [mixed $parameter = null])
-
string
$statementName: The name of the statement to execute.
-
mixed
$parameter: The parameter object.
Flushes all cached objects that belong to this SqlMap
void
flushCaches
()
Executes a Sql INSERT statement.
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.
mixed
insert
(string $statementName, [string $parameter = null])
-
string
$statementName: The name of the statement to execute.
-
string
$parameter: The parameter object.
Executes a Sql SELECT statement that returns data to populate a number of result objects.
The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.
TList
queryForList
(
string $statementName, [
mixed $parameter =
null], [
TList $result =
null], [
int $skip =
-1], [
int $max =
-1])
-
string
$statementName: The name of the sql statement to execute.
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
TList
$result: An Ilist object used to hold the objects, pass in null if want to return a list instead.
-
int
$skip: The number of rows to skip over.
-
int
$max: The maximum number of rows to return.
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.
TMap
queryForMap
(
string $statementName, [
mixed $parameter =
null], [
string $keyProperty =
null], [
string $valueProperty =
null], [
mixed $skip =
-1], [
mixed $max =
-1])
-
string
$statementName: The name of the sql statement to execute.
-
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.
Runs a query with a custom object that gets a chance to deal with each row as it is processed.
Example: $sqlmap->queryForMapWithRowDelegate('getAccounts', array($this, 'rowHandler'));
TMap
queryForMapWithRowDelegate
(
string $statementName,
callback $delegate, [
mixed $parameter =
null], [
string $keyProperty =
null], [
string $valueProperty =
null], [
mixed $skip =
-1], [
mixed $max =
-1])
-
string
$statementName: The name of the sql statement to execute.
-
callback
$delegate: Row delegate handler, a valid callback required.
-
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.
Executes a Sql SELECT statement that returns that returns data to populate a single object instance.
The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.
object A
queryForObject
(string $statementName, [mixed $parameter = null], [mixed $result = null])
-
string
$statementName: The name of the sql statement to execute.
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
mixed
$result: An object of the type to be returned.
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.
TPagedList
queryForPagedList
(
string $statementName, [
mixed $parameter =
null], [
integer $pageSize =
10])
-
string
$statementName: The name of the sql statement to execute.
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
integer
$pageSize: The maximum number of objects to store in each page.
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.
Runs paged list query with row delegate Example: $sqlmap->queryForPagedListWithRowDelegate('getAccounts', array($this, 'rowHandler'));
TPagedList
queryForPagedListWithRowDelegate
(
string $statementName,
callback $delegate, [
mixed $parameter =
null], [
integer $pageSize =
10])
-
string
$statementName: The name of the sql statement to execute.
-
callback
$delegate: Row delegate handler, a valid callback required.
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
integer
$pageSize: The maximum number of objects to store in each page.
Runs a query for list with a custom object that gets a chance to deal with each row as it is processed.
Example: $sqlmap->queryWithRowDelegate('getAccounts', array($this, 'rowHandler'));
TList
queryWithRowDelegate
(
string $statementName,
callback $delegate, [
mixed $parameter =
null], [
TList $result =
null], [
int $skip =
-1], [
int $max =
-1])
-
string
$statementName: The name of the sql statement to execute.
-
callback
$delegate: Row delegate handler, a valid callback required.
-
mixed
$parameter: The object used to set the parameters in the SQL.
-
TList
$result: An Ilist object used to hold the objects, pass in null if want to return a list instead.
-
int
$skip: The number of rows to skip over.
-
int
$max: The maximum number of rows to return.
Executes a Sql UPDATE statement.
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).
integer
update
(string $statementName, [mixed $parameter = null])
-
string
$statementName: The name of the statement to execute.
-
mixed
$parameter: The parameter 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()