Search criteria for TDbDataGateway.
Criteria object for data gateway finder methods. Usage:
- $criteria = new TSqlCriteria();
- $criteria->Parameters[':name'] = 'admin';
- $criteria->Parameters[':pass'] = 'prado';
- $criteria->OrdersBy['level'] = 'desc';
- $criteria->OrdersBy['name'] = 'asc';
- $criteria->Limit = 10;
- $criteria->Offset = 20;
| Method Details |
getCondition
| public string getCondition |
() |
| Output |
|
string
| search conditions. |
| Exception |
|
getIsNamedParameters
| public boolean getIsNamedParameters |
() |
| Output |
|
boolean
| true if the parameter index are string base, false otherwise. |
| Exception |
|
getLimit
| Output |
|
int
| maximum number of records to return. |
| Exception |
|
getOffset
| Output |
|
int
| record offset. |
| Exception |
|
getOrdersBy
|
getParameters
|
getSelect
| public mixed getSelect |
() |
Gets the field list to be placed after the SELECT in the SQL. Default to '*'
|
setCondition
| public void setCondition |
(string $value ) |
Sets the search conditions to be placed after the WHERE clause in the SQL.
| Input |
| string | $value | search conditions. |
| Output |
| Exception |
|
setLimit
| public void setLimit |
(int $value ) |
| Input |
| int | $value | maximum number of records to return. |
| Output |
| Exception |
|
setOffset
| public void setOffset |
(int $value ) |
| Input |
| int | $value | record offset. |
| Output |
| Exception |
|
setOrdersBy
| public void setOrdersBy |
(mixed $value ) |
| Input |
| mixed | $value | ordering clause. |
| Output |
| Exception |
|
setParameters
| public void setParameters |
(ArrayAccess $value ) |
| Input |
| ArrayAccess | $value | named parameters. |
| Output |
| Exception |
|
setSelect
| public void setSelect |
(mixed $value ) |
Sets the field list to be placed after the SELECT in the SQL.
Different behavior depends on type of assigned value string usage without modification null will be expanded to full list of quoted table column names (quoting depends on database) array - Column names will be quoted if used as key or value of array
- array('col1', 'col2', 'col2')
- // SELECT `col1`, `col2`, `col3` FROM...
- Column aliasing
- array('mycol1' => 'col1', 'mycol2' => 'COUNT(*)')
- // SELECT `col1` AS mycol1, COUNT(*) AS mycol2 FROM...
- NULL and scalar values (strings will be quoted depending on database)
- array('col1' => 'my custom string', 'col2' => 1.0, 'col3' => 'NULL')
- // SELECT "my custom string" AS `col1`, 1.0 AS `col2`, NULL AS `col3` FROM...
- If the *-wildcard char is used as key or value, add the full list of quoted table column names
- array('col1' => 'NULL', '*')
- // SELECT `col1`, `col2`, `col3`, NULL AS `col1` FROM...
| Input |
| mixed | $value | |
| Output |
| Exception |
|
__toString
| public string __toString |
() |
| Output |
|
string
| string representation of the parameters. Useful for debugging. |
| Exception |
|