Operators
The operator for a criteria item in a query can be specified as a string, or using a class constant. For more concise syntax, the QueryBuilder class can be referred to using the alias QB, and each operator has a shorthand alias also. But you can just use the operator itself as a string if you prefer. The following operators are supported (all are case insensitive):
Operator String
Constant
Notes
=
QB::EQUALS or QB::EQ
!=
QB::NOT_EQUALS or QB::NOT_EQ
>
QB::GREATER_THAN or QB::GT
>=
QB::GREATER_THAN_OR_EQUAL_TO or QB::GTE
<
QB::LESS_THAN or QB::LT
<=
QB::LESS_THAN_OR_EQUAL_TO or QB::LTE
IN
QB::IN
Value must be an array
NOT IN
QB::NOT_IN
Value must be an array
IS
QB::IS
Value must be null
IS NOT
QB::IS_NOT
Value must be null
BETWEEN
QB::BETWEEN
Two values must be supplied (in an array)
BEGINSWITH
QB::BEGINS_WITH
ENDSWITH
QB::ENDS_WITH
CONTAINS
QB::CONTAINS
LIKE
QB::LIKE
Last updated
Was this helpful?