Criteria
in package
Criteria for filtering Selectable collections.
Tags
Table of Contents
Constants
Properties
- $expression : Expression|null
- $expressionBuilder : ExpressionBuilder|null
- $firstResult : int|null
- $maxResults : int|null
- $orderings : array<string|int, string>
Methods
- __construct() : mixed
- Construct a new Criteria.
- andWhere() : $this
- Appends the where expression to evaluate when this Criteria is searched for using an AND with previous expression.
- create() : Criteria
- Creates an instance of the class.
- expr() : ExpressionBuilder
- Returns the expression builder.
- getFirstResult() : int|null
- Gets the current first result option of this Criteria.
- getMaxResults() : int|null
- Gets maxResults.
- getOrderings() : array<string|int, string>
- Gets the current orderings of this Criteria.
- getWhereExpression() : Expression|null
- Gets the expression attached to this Criteria.
- orderBy() : $this
- Sets the ordering of the result of this Criteria.
- orWhere() : $this
- Appends the where expression to evaluate when this Criteria is searched for using an OR with previous expression.
- setFirstResult() : $this
- Set the number of first result that this Criteria should return.
- setMaxResults() : $this
- Sets maxResults.
- where() : $this
- Sets the where expression to evaluate when this Criteria is searched for.
Constants
ASC
public
mixed
ASC
= 'ASC'
DESC
public
mixed
DESC
= 'DESC'
Properties
$expression
private
Expression|null
$expression
$expressionBuilder
private
static ExpressionBuilder|null
$expressionBuilder
$firstResult
private
int|null
$firstResult
$maxResults
private
int|null
$maxResults
$orderings
private
array<string|int, string>
$orderings
= []
Methods
__construct()
Construct a new Criteria.
public
__construct([Expression|null $expression = null ][, array<string|int, string>|null $orderings = null ][, int|null $firstResult = null ][, int|null $maxResults = null ]) : mixed
Parameters
- $expression : Expression|null = null
- $orderings : array<string|int, string>|null = null
- $firstResult : int|null = null
- $maxResults : int|null = null
andWhere()
Appends the where expression to evaluate when this Criteria is searched for using an AND with previous expression.
public
andWhere(Expression $expression) : $this
Parameters
- $expression : Expression
Return values
$thiscreate()
Creates an instance of the class.
public
static create() : Criteria
Return values
Criteriaexpr()
Returns the expression builder.
public
static expr() : ExpressionBuilder
Return values
ExpressionBuildergetFirstResult()
Gets the current first result option of this Criteria.
public
getFirstResult() : int|null
Return values
int|nullgetMaxResults()
Gets maxResults.
public
getMaxResults() : int|null
Return values
int|nullgetOrderings()
Gets the current orderings of this Criteria.
public
getOrderings() : array<string|int, string>
Return values
array<string|int, string>getWhereExpression()
Gets the expression attached to this Criteria.
public
getWhereExpression() : Expression|null
Return values
Expression|nullorderBy()
Sets the ordering of the result of this Criteria.
public
orderBy(array<string|int, string> $orderings) : $this
Keys are field and values are the order, being either ASC or DESC.
Parameters
- $orderings : array<string|int, string>
Tags
Return values
$thisorWhere()
Appends the where expression to evaluate when this Criteria is searched for using an OR with previous expression.
public
orWhere(Expression $expression) : $this
Parameters
- $expression : Expression
Return values
$thissetFirstResult()
Set the number of first result that this Criteria should return.
public
setFirstResult(int|null $firstResult) : $this
Parameters
- $firstResult : int|null
-
The value to set.
Return values
$thissetMaxResults()
Sets maxResults.
public
setMaxResults(int|null $maxResults) : $this
Parameters
- $maxResults : int|null
-
The value to set.
Return values
$thiswhere()
Sets the where expression to evaluate when this Criteria is searched for.
public
where(Expression $expression) : $this
Parameters
- $expression : Expression