IExpressionBuilder
in
This class provides a wrapper around Doctrine's ExpressionBuilder
Tags
Table of Contents
Constants
- EQ = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::EQ
- GT = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::GT
- GTE = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::GTE
- LT = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::LT
- LTE = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::LTE
- NEQ = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::NEQ
Methods
- andX() : ICompositeExpression
- Creates a conjunction of the given boolean expressions.
- bitwiseAnd() : IQueryFunction
- Creates a bitwise AND comparison
- bitwiseOr() : IQueryFunction
- Creates a bitwise OR comparison
- castColumn() : IQueryFunction
- Returns a IQueryFunction that casts the column to the given type
- comparison() : string
- Creates a comparison expression.
- emptyString() : string
- Creates a $x = '' statement, because Oracle needs a different check
- eq() : string
- Creates an equality comparison expression with the given arguments.
- gt() : string
- Creates a greater-than comparison expression with the given arguments.
- gte() : string
- Creates a greater-than-equal comparison expression with the given arguments.
- iLike() : string
- Creates a ILIKE() comparison expression with the given arguments.
- in() : string
- Creates a IN () comparison expression with the given arguments.
- isNotNull() : string
- Creates an IS NOT NULL expression with the given arguments.
- isNull() : string
- Creates an IS NULL expression with the given arguments.
- like() : string
- Creates a LIKE() comparison expression with the given arguments.
- literal() : ILiteral
- Quotes a given input parameter.
- lt() : string
- Creates a lower-than comparison expression with the given arguments.
- lte() : string
- Creates a lower-than-equal comparison expression with the given arguments.
- neq() : string
- Creates a non equality comparison expression with the given arguments.
- nonEmptyString() : string
- Creates a `$x <> ''` statement, because Oracle needs a different check
- notIn() : string
- Creates a NOT IN () comparison expression with the given arguments.
- notLike() : string
- Creates a NOT LIKE() comparison expression with the given arguments.
- orX() : ICompositeExpression
- Creates a disjunction of the given boolean expressions.
Constants
EQ
public
mixed
EQ
= \Doctrine\DBAL\Query\Expression\ExpressionBuilder::EQ
Tags
GT
public
mixed
GT
= \Doctrine\DBAL\Query\Expression\ExpressionBuilder::GT
Tags
GTE
public
mixed
GTE
= \Doctrine\DBAL\Query\Expression\ExpressionBuilder::GTE
Tags
LT
public
mixed
LT
= \Doctrine\DBAL\Query\Expression\ExpressionBuilder::LT
Tags
LTE
public
mixed
LTE
= \Doctrine\DBAL\Query\Expression\ExpressionBuilder::LTE
Tags
NEQ
public
mixed
NEQ
= \Doctrine\DBAL\Query\Expression\ExpressionBuilder::NEQ
Tags
Methods
andX()
Creates a conjunction of the given boolean expressions.
public
andX(mixed ...$x) : ICompositeExpression
Example:
[php] // (u.type = ?) AND (u.role = ?) $expr->andX('u.type = ?', 'u.role = ?'));
Parameters
- $x : mixed
-
Optional clause. Defaults = null, but requires at least one defined when converting to string.
Tags
Return values
ICompositeExpressionbitwiseAnd()
Creates a bitwise AND comparison
public
bitwiseAnd(string|ILiteral $x, int $y) : IQueryFunction
Parameters
- $x : string|ILiteral
-
The field or value to check
- $y : int
-
Bitmap that must be set
Tags
Return values
IQueryFunctionbitwiseOr()
Creates a bitwise OR comparison
public
bitwiseOr(string|ILiteral $x, int $y) : IQueryFunction
Parameters
- $x : string|ILiteral
-
The field or value to check
- $y : int
-
Bitmap that must be set
Tags
Return values
IQueryFunctioncastColumn()
Returns a IQueryFunction that casts the column to the given type
public
castColumn(string|IQueryFunction $column, mixed $type) : IQueryFunction
Parameters
- $column : string|IQueryFunction
- $type : mixed
-
One of IQueryBuilder::PARAM_*
Tags
Return values
IQueryFunctioncomparison()
Creates a comparison expression.
public
comparison(mixed $x, string $operator, mixed $y[, mixed|null $type = null ]) : string
Parameters
- $x : mixed
-
The left expression.
- $operator : string
-
One of the IExpressionBuilder::* constants.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringemptyString()
Creates a $x = '' statement, because Oracle needs a different check
public
emptyString(string|ILiteral|IParameter|IQueryFunction $x) : string
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
The field in string format to be inspected by the comparison.
Tags
Return values
stringeq()
Creates an equality comparison expression with the given arguments.
public
eq(mixed $x, mixed $y[, mixed|null $type = null ]) : string
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a
[php]
// u.id = ?
$expr->eq('u.id', '?');
Parameters
- $x : mixed
-
The left expression.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringgt()
Creates a greater-than comparison expression with the given arguments.
public
gt(mixed $x, mixed $y[, mixed|null $type = null ]) : string
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a
[php]
// u.id > ?
$q->where($q->expr()->gt('u.id', '?'));
Parameters
- $x : mixed
-
The left expression.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringgte()
Creates a greater-than-equal comparison expression with the given arguments.
public
gte(mixed $x, mixed $y[, mixed|null $type = null ]) : string
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a
[php]
// u.id >= ?
$q->where($q->expr()->gte('u.id', '?'));
Parameters
- $x : mixed
-
The left expression.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringiLike()
Creates a ILIKE() comparison expression with the given arguments.
public
iLike(string $x, mixed $y[, mixed|null $type = null ]) : string
Parameters
- $x : string
-
Field in string format to be inspected by ILIKE() comparison.
- $y : mixed
-
Argument to be used in ILIKE() comparison.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringin()
Creates a IN () comparison expression with the given arguments.
public
in(ILiteral|IParameter|IQueryFunction|string $x, ILiteral|IParameter|IQueryFunction|string|array<string|int, mixed> $y[, mixed|null $type = null ]) : string
Parameters
- $x : ILiteral|IParameter|IQueryFunction|string
-
The field in string format to be inspected by IN() comparison.
- $y : ILiteral|IParameter|IQueryFunction|string|array<string|int, mixed>
-
The placeholder or the array of values to be used by IN() comparison.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringisNotNull()
Creates an IS NOT NULL expression with the given arguments.
public
isNotNull(string|ILiteral|IParameter|IQueryFunction $x) : string
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
The field in string format to be restricted by IS NOT NULL.
Tags
Return values
stringisNull()
Creates an IS NULL expression with the given arguments.
public
isNull(string|ILiteral|IParameter|IQueryFunction $x) : string
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
The field in string format to be restricted by IS NULL.
Tags
Return values
stringlike()
Creates a LIKE() comparison expression with the given arguments.
public
like(ILiteral|IParameter|IQueryFunction|string $x, mixed $y[, mixed|null $type = null ]) : string
Parameters
- $x : ILiteral|IParameter|IQueryFunction|string
-
Field in string format to be inspected by LIKE() comparison.
- $y : mixed
-
Argument to be used in LIKE() comparison.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringliteral()
Quotes a given input parameter.
public
literal(mixed $input[, int $type = IQueryBuilder::PARAM_STR ]) : ILiteral
Parameters
- $input : mixed
-
The parameter to be quoted.
- $type : int = IQueryBuilder::PARAM_STR
-
One of the IQueryBuilder::PARAM_* constants
Tags
Return values
ILiterallt()
Creates a lower-than comparison expression with the given arguments.
public
lt(mixed $x, mixed $y[, mixed|null $type = null ]) : string
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a
[php]
// u.id < ?
$q->where($q->expr()->lt('u.id', '?'));
Parameters
- $x : mixed
-
The left expression.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringlte()
Creates a lower-than-equal comparison expression with the given arguments.
public
lte(mixed $x, mixed $y[, mixed|null $type = null ]) : string
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a
[php]
// u.id <= ?
$q->where($q->expr()->lte('u.id', '?'));
Parameters
- $x : mixed
-
The left expression.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringneq()
Creates a non equality comparison expression with the given arguments.
public
neq(mixed $x, mixed $y[, mixed|null $type = null ]) : string
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a
[php]
// u.id <> 1
$q->where($q->expr()->neq('u.id', '1'));
Parameters
- $x : mixed
-
The left expression.
- $y : mixed
-
The right expression.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringnonEmptyString()
Creates a `$x <> ''` statement, because Oracle needs a different check
public
nonEmptyString(string|ILiteral|IParameter|IQueryFunction $x) : string
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
The field in string format to be inspected by the comparison.
Tags
Return values
stringnotIn()
Creates a NOT IN () comparison expression with the given arguments.
public
notIn(ILiteral|IParameter|IQueryFunction|string $x, ILiteral|IParameter|IQueryFunction|string|array<string|int, mixed> $y[, mixed|null $type = null ]) : string
Parameters
- $x : ILiteral|IParameter|IQueryFunction|string
-
The field in string format to be inspected by NOT IN() comparison.
- $y : ILiteral|IParameter|IQueryFunction|string|array<string|int, mixed>
-
The placeholder or the array of values to be used by NOT IN() comparison.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringnotLike()
Creates a NOT LIKE() comparison expression with the given arguments.
public
notLike(ILiteral|IParameter|IQueryFunction|string $x, mixed $y[, mixed|null $type = null ]) : string
Parameters
- $x : ILiteral|IParameter|IQueryFunction|string
-
Field in string format to be inspected by NOT LIKE() comparison.
- $y : mixed
-
Argument to be used in NOT LIKE() comparison.
- $type : mixed|null = null
-
one of the IQueryBuilder::PARAM_* constants required when comparing text fields for oci compatibility
Tags
Return values
stringorX()
Creates a disjunction of the given boolean expressions.
public
orX(mixed ...$x) : ICompositeExpression
Example:
[php] // (u.type = ?) OR (u.role = ?) $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?'));
Parameters
- $x : mixed
-
Optional clause. Defaults = null, but requires at least one defined when converting to string.