PHP Класс 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;
С версии: 3.1
Наследование: extends Prado\TComponent
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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

__toString() публичный Метод

public __toString ( ) : string
Результат string string representation of the parameters. Useful for debugging.

getCondition() публичный Метод

public getCondition ( ) : string
Результат string search conditions.

getIsNamedParameters() публичный Метод

public getIsNamedParameters ( ) : boolean
Результат boolean true if the parameter index are string base, false otherwise.

getLimit() публичный Метод

public getLimit ( ) : integer
Результат integer maximum number of records to return.

getOffset() публичный Метод

public getOffset ( ) : integer
Результат integer record offset.

getOrdersBy() публичный Метод

public getOrdersBy ( ) : TAttributeCollection
Результат Prado\Collections\TAttributeCollection ordering clause.

getParameters() публичный Метод

public getParameters ( ) : TAttributeCollection
Результат Prado\Collections\TAttributeCollection list of named parameters and values.

getSelect() публичный Метод

Gets the field list to be placed after the SELECT in the SQL. Default to '*'
С версии: 3.1.7
public getSelect ( ) : mixed
Результат mixed

setCondition() публичный Метод

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

setLimit() публичный Метод

public setLimit ( $value )

setOffset() публичный Метод

public setOffset ( $value )

setOrdersBy() публичный Метод

public setOrdersBy ( $value )

setParameters() публичный Метод

public setParameters ( $value )

setSelect() публичный Метод

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...
См. также: TDbCommandBuilder::getSelectFieldList()
С версии: 3.1.7
public setSelect ( $value )