Documentation

Criteria
in package

Criteria for filtering Selectable collections.

Tags
psalm-consistent-constructor

Table of Contents

Constants

ASC  = 'ASC'
DESC  = 'DESC'

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

Properties

$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
$this

getFirstResult()

Gets the current first result option of this Criteria.

public getFirstResult() : int|null
Return values
int|null

getMaxResults()

Gets maxResults.

public getMaxResults() : int|null
Return values
int|null

getOrderings()

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|null

orderBy()

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
see
Criteria::ASC
see
Criteria::DESC
Return values
$this

orWhere()

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
$this

setFirstResult()

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
$this

setMaxResults()

Sets maxResults.

public setMaxResults(int|null $maxResults) : $this
Parameters
$maxResults : int|null

The value to set.

Return values
$this

where()

Sets the where expression to evaluate when this Criteria is searched for.

public where(Expression $expression) : $this
Parameters
$expression : Expression
Return values
$this

        
On this page

Search results