PHP Class Prado\Data\DataGateway\TSqlCriteria

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;
Since: 3.1
Inheritance: extends Prado\TComponent
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $condition = null, $parameters = [] ) Creates a new criteria with given condition;
__toString ( ) : string
getCondition ( ) : string
getIsNamedParameters ( ) : boolean
getLimit ( ) : integer
getOffset ( ) : integer
getOrdersBy ( ) : TAttributeCollection
getParameters ( ) : TAttributeCollection
getSelect ( ) : mixed Gets the field list to be placed after the SELECT in the SQL. Default to '*'
setCondition ( $value ) Sets the search conditions to be placed after the WHERE clause in the SQL.
setLimit ( $value )
setOffset ( $value )
setOrdersBy ( $value )
setParameters ( $value )
setSelect ( $value ) Sets the field list to be placed after the SELECT in the SQL.

Method Details

__construct() public méthode

Creates a new criteria with given condition;
public __construct ( $condition = null, $parameters = [] )

__toString() public méthode

public __toString ( ) : string
Résultat string string representation of the parameters. Useful for debugging.

getCondition() public méthode

public getCondition ( ) : string
Résultat string search conditions.

getIsNamedParameters() public méthode

public getIsNamedParameters ( ) : boolean
Résultat boolean true if the parameter index are string base, false otherwise.

getLimit() public méthode

public getLimit ( ) : integer
Résultat integer maximum number of records to return.

getOffset() public méthode

public getOffset ( ) : integer
Résultat integer record offset.

getOrdersBy() public méthode

public getOrdersBy ( ) : TAttributeCollection
Résultat Prado\Collections\TAttributeCollection ordering clause.

getParameters() public méthode

public getParameters ( ) : TAttributeCollection
Résultat Prado\Collections\TAttributeCollection list of named parameters and values.

getSelect() public méthode

Gets the field list to be placed after the SELECT in the SQL. Default to '*'
Since: 3.1.7
public getSelect ( ) : mixed
Résultat mixed

setCondition() public méthode

Sets the search conditions to be placed after the WHERE clause in the SQL.
public setCondition ( $value )

setLimit() public méthode

public setLimit ( $value )

setOffset() public méthode

public setOffset ( $value )

setOrdersBy() public méthode

public setOrdersBy ( $value )

setParameters() public méthode

public setParameters ( $value )

setSelect() public méthode

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...
See also: TDbCommandBuilder::getSelectFieldList()
Since: 3.1.7
public setSelect ( $value )