class Criteria (View source)

Criteria for filtering Selectable collections.

Constants

ASC

DESC

Methods

static Criteria
create()

Creates an instance of the class.

expr()

Return the expression builder.

__construct(Expression $expression = null, array $orderings = null, int $firstResult = null, int $maxResults = null)

Construct new criteria

where(Expression $expression)

Set the where expression to evaluate when this criteria is searched for.

andWhere(Expression $expression)

Append the where expression to evaluate when this criteria is searched for using an AND with previous expression.

orWhere(Expression $expression)

Append the where expression to evaluate when this criteria is searched for using an OR with previous expression.

Expression|null
getWhereExpression()

Get the expression attached to this criteria.

array
getOrderings()

Get current orderings of this Criteria

orderBy(array $orderings)

Set the ordering of the result of this criteria.

firstResult.
getFirstResult()

Get current first result option of the critera.

setFirstResult(firstResult $firstResult)

Set number of first result that this criteria should return.

maxResults.
getMaxResults()

Get maxResults.

setMaxResults(maxResults $maxResults)

Set maxResults.

Details

static Criteria create()

Creates an instance of the class.

Return Value

Criteria

static ExpressionBuilder expr()

Return the expression builder.

Return Value

ExpressionBuilder

__construct(Expression $expression = null, array $orderings = null, int $firstResult = null, int $maxResults = null)

Construct new criteria

Parameters

Expression $expression
array $orderings
int $firstResult
int $maxResults

Criteria where(Expression $expression)

Set the where expression to evaluate when this criteria is searched for.

Parameters

Expression $expression

Return Value

Criteria

Criteria andWhere(Expression $expression)

Append the where expression to evaluate when this criteria is searched for using an AND with previous expression.

Parameters

Expression $expression

Return Value

Criteria

Criteria orWhere(Expression $expression)

Append the where expression to evaluate when this criteria is searched for using an OR with previous expression.

Parameters

Expression $expression

Return Value

Criteria

Expression|null getWhereExpression()

Get the expression attached to this criteria.

Return Value

Expression|null

array getOrderings()

Get current orderings of this Criteria

Return Value

array

Criteria orderBy(array $orderings)

Set the ordering of the result of this criteria.

Keys are field and values are the order, being either ASC or DESC.

Parameters

array $orderings

Return Value

Criteria

See also

Criteria::ASC
Criteria::DESC

firstResult. getFirstResult()

Get current first result option of the critera.

Return Value

firstResult.

Criteria setFirstResult(firstResult $firstResult)

Set number of first result that this criteria should return.

Parameters

firstResult $firstResult the value to set.

Return Value

Criteria

maxResults. getMaxResults()

Get maxResults.

Return Value

maxResults.

Criteria setMaxResults(maxResults $maxResults)

Set maxResults.

Parameters

maxResults $maxResults the value to set.

Return Value

Criteria