package Default
inherited_from \Zend\Db\Sql\Predicate\Predicate

 Methods

Constructor

__construct(null|array $predicates = null, string $defaultCombination = self::COMBINED_BY_AND
Inherited

Parameters

$predicates

nullarray

$defaultCombination

string

Overloading

__get(string $name) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Overloads "or", "and", "nest", and "unnest"

Parameters

$name

string

Returns

\Zend\Db\Sql\Predicate\Predicate

Add predicate to set

addPredicate(\Zend\Db\Sql\Predicate\PredicateInterface $predicate, string $combination = null) : \Zend\Db\Sql\Predicate\PredicateSet
Inherited

Parameters

$predicate

\Zend\Db\Sql\Predicate\PredicateInterface

$combination

string

Returns

\Zend\Db\Sql\Predicate\PredicateSet

Add predicates to set

addPredicates(\Zend\Db\Sql\Predicate\PredicateInterface|\Closure|string|array $predicates, string $combination = self::OP_AND) : \Zend\Db\Sql\Predicate\PredicateSet
Inherited

Parameters

$predicates

\Zend\Db\Sql\Predicate\PredicateInterface\Closurestringarray

$combination

string

Returns

\Zend\Db\Sql\Predicate\PredicateSet

Add predicate using AND operator

andPredicate(\Zend\Db\Sql\Predicate\PredicateInterface $predicate) : \Zend\Db\Sql\Predicate\PredicateSet
Inherited

Parameters

$predicate

\Zend\Db\Sql\Predicate\PredicateInterface

Returns

\Zend\Db\Sql\Predicate\PredicateSet

Create "between" predicate

between(string $identifier, integer|float|string $minValue, integer|float|string $maxValue) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Between predicate

Parameters

$identifier

string

$minValue

integerfloatstring

$maxValue

integerfloatstring

Returns

\Zend\Db\Sql\Predicate\Predicate

Get count of attached predicates

count() : integer
Inherited

Returns

integer

Create "Equal To" predicate

equalTo(integer|float|boolean|string $left, integer|float|boolean|string $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Operator predicate

Parameters

$left

integerfloatbooleanstring

$right

integerfloatbooleanstring

$leftType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}

$rightType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}

Returns

\Zend\Db\Sql\Predicate\Predicate

Create an expression, with parameter placeholders

expression($expression, $parameters) : \Zend\Db\Sql\Having
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$expression

$parameters

Returns

\Zend\Db\Sql\Having

Get predicate parts for where statement

getExpressionData() : array
Inherited

Returns

array

Return the predicates

getPredicates() : array<mixed,\Zend\Db\Sql\Predicate\PredicateInterface>
Inherited

Returns

array<mixed,\Zend\Db\Sql\Predicate\PredicateInterface>

Create "Greater Than" predicate

greaterThan(integer|float|boolean|string $left, integer|float|boolean|string $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Operator predicate

Parameters

$left

integerfloatbooleanstring

$right

integerfloatbooleanstring

$leftType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}

$rightType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "Greater Than Or Equal To" predicate

greaterThanOrEqualTo(integer|float|boolean|string $left, integer|float|boolean|string $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Operator predicate

Parameters

$left

integerfloatbooleanstring

$right

integerfloatbooleanstring

$leftType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}

$rightType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "IN" predicate

in(string $identifier, array|\Zend\Db\Sql\Select $valueSet = null) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes In predicate

Parameters

$identifier

string

$valueSet

array\Zend\Db\Sql\Select

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "IS NOT NULL" predicate

isNotNull(string $identifier) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes IsNotNull predicate

Parameters

$identifier

string

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "IS NULL" predicate

isNull(string $identifier) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes IsNull predicate

Parameters

$identifier

string

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "Less Than" predicate

lessThan(integer|float|boolean|string $left, integer|float|boolean|string $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Operator predicate

Parameters

$left

integerfloatbooleanstring

$right

integerfloatbooleanstring

$leftType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}

$rightType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "Less Than Or Equal To" predicate

lessThanOrEqualTo(integer|float|boolean|string $left, integer|float|boolean|string $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Operator predicate

Parameters

$left

integerfloatbooleanstring

$right

integerfloatbooleanstring

$leftType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}

$rightType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "Like" predicate

like(string $identifier, string $like) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Like predicate

Parameters

$identifier

string

$like

string

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "Literal" predicate

literal(string $literal) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Literal predicate, for parameters, use expression()

Parameters

$literal

string

Returns

\Zend\Db\Sql\Predicate\Predicate

Begin nesting predicates

nest() : \Zend\Db\Sql\Predicate\Predicate
Inherited

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "Not Equal To" predicate

notEqualTo(integer|float|boolean|string $left, integer|float|boolean|string $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes Operator predicate

Parameters

$left

integerfloatbooleanstring

$right

integerfloatbooleanstring

$leftType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}

$rightType

string

TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "NOT IN" predicate

notIn(string $identifier, array|\Zend\Db\Sql\Select $valueSet = null) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes NotIn predicate

Parameters

$identifier

string

$valueSet

array\Zend\Db\Sql\Select

Returns

\Zend\Db\Sql\Predicate\Predicate

Create "notLike" predicate

notLike(string $identifier, string $notLike) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Utilizes In predicate

Parameters

$identifier

string

$notLike

string

Returns

\Zend\Db\Sql\Predicate\Predicate

Add predicate using OR operator

orPredicate(\Zend\Db\Sql\Predicate\PredicateInterface $predicate) : \Zend\Db\Sql\Predicate\PredicateSet
Inherited

Parameters

$predicate

\Zend\Db\Sql\Predicate\PredicateInterface

Returns

\Zend\Db\Sql\Predicate\PredicateSet

Use given predicate directly

predicate(\Zend\Db\Sql\Predicate\PredicateInterface $predicate) : \Zend\Db\Sql\Predicate\Predicate
Inherited

Contrary to \addPredicate() this method respects formerly set AND / OR combination operator, thus allowing generic predicates to be used fluently within where chains as any other concrete predicate.

Parameters

$predicate

\Zend\Db\Sql\Predicate\PredicateInterface

Returns

\Zend\Db\Sql\Predicate\Predicate

Indicate what predicate will be unnested

setUnnest(\Zend\Db\Sql\Predicate\Predicate $predicate) : void
Inherited

Parameters

$predicate

\Zend\Db\Sql\Predicate\Predicate

Indicate end of nested predicate

unnest() : \Zend\Db\Sql\Predicate\Predicate
Inherited

Exceptions

\Zend\Db\Sql\Exception\RuntimeException

Returns

\Zend\Db\Sql\Predicate\Predicate

 Properties

 

$defaultCombination

$defaultCombination 

Default

self::COMBINED_BY_AND
 

$nextPredicateCombineOperator

$nextPredicateCombineOperator 

Default

null
 

$predicates

$predicates 

Default

array()
 

$unnest

$unnest 

Default

null

 Constants

 

COMBINED_BY_AND

COMBINED_BY_AND = 'AND' 
 

COMBINED_BY_OR

COMBINED_BY_OR = 'OR' 
 

OP_AND

OP_AND = 'AND' 
 

OP_OR

OP_OR = 'OR'