| Methods |
public
|
__construct(Connection $connection)
Initializes a new <tt>ExpressionBuilder</tt>.
Initializes a new ExpressionBuilder.
Parameters
| $connection |
The DBAL Connection.
|
|
#
|
public
|
and(string|CompositeExpression $expression, string|CompositeExpression ...$expressions): CompositeExpression
Creates a conjunction of the given expressions.
Creates a conjunction of the given expressions.
|
#
|
public
|
or(string|CompositeExpression $expression, string|CompositeExpression ...$expressions): CompositeExpression
Creates a disjunction of the given expressions.
Creates a disjunction of the given expressions.
|
#
|
public
|
andX(mixed $x = null): CompositeExpression
Deprecated
Parameters
| $x |
Optional clause. Defaults = null, but requires
at least one defined when converting to string.
|
|
#
|
public
|
orX(mixed $x = null): CompositeExpression
Deprecated
Parameters
| $x |
Optional clause. Defaults = null, but requires
at least one defined when converting to string.
|
|
#
|
public
|
comparison(mixed $x, string $operator, mixed $y): string
Creates a comparison expression.
Creates a comparison expression.
Parameters
| $x |
The left expression.
|
| $operator |
One of the ExpressionBuilder::* constants.
|
| $y |
The right expression.
|
|
#
|
public
|
eq(mixed $x, mixed $y): string
Creates an equality comparison expression with the given arguments.
Creates an equality comparison expression with the given arguments.
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a = . Example:
[php]
// u.id = ?
$expr->eq('u.id', '?');
Parameters
| $x |
The left expression.
|
| $y |
The right expression.
|
|
#
|
public
|
neq(mixed $x, mixed $y): string
Creates a non equality comparison expression with the given arguments.
First argument is considered the left expression…
Creates a non equality comparison expression with the given arguments.
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a <> . Example:
[php]
// u.id <> 1
$q->where($q->expr()->neq('u.id', '1'));
Parameters
| $x |
The left expression.
|
| $y |
The right expression.
|
|
#
|
public
|
lt(mixed $x, mixed $y): string
Creates a lower-than comparison expression with the given arguments.
First argument is considered the left expression…
Creates a lower-than comparison expression with the given arguments.
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a < . Example:
[php]
// u.id < ?
$q->where($q->expr()->lt('u.id', '?'));
Parameters
| $x |
The left expression.
|
| $y |
The right expression.
|
|
#
|
public
|
lte(mixed $x, mixed $y): string
Creates a lower-than-equal comparison expression with the given arguments.
First argument is considered the left…
Creates a lower-than-equal comparison expression with the given arguments.
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a <= . Example:
[php]
// u.id <= ?
$q->where($q->expr()->lte('u.id', '?'));
Parameters
| $x |
The left expression.
|
| $y |
The right expression.
|
|
#
|
public
|
gt(mixed $x, mixed $y): string
Creates a greater-than comparison expression with the given arguments.
First argument is considered the left expression…
Creates a greater-than comparison expression with the given arguments.
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a > . Example:
[php]
// u.id > ?
$q->where($q->expr()->gt('u.id', '?'));
Parameters
| $x |
The left expression.
|
| $y |
The right expression.
|
|
#
|
public
|
gte(mixed $x, mixed $y): string
Creates a greater-than-equal comparison expression with the given arguments.
First argument is considered the left…
Creates a greater-than-equal comparison expression with the given arguments.
First argument is considered the left expression and the second is the right expression.
When converted to string, it will generated a >= . Example:
[php]
// u.id >= ?
$q->where($q->expr()->gte('u.id', '?'));
Parameters
| $x |
The left expression.
|
| $y |
The right expression.
|
|
#
|
public
|
isNull(string $x): string
Creates an IS NULL expression with the given arguments.
Creates an IS NULL expression with the given arguments.
Parameters
| $x |
The expression to be restricted by IS NULL.
|
|
#
|
public
|
isNotNull(string $x): string
Creates an IS NOT NULL expression with the given arguments.
Creates an IS NOT NULL expression with the given arguments.
Parameters
| $x |
The expression to be restricted by IS NOT NULL.
|
|
#
|
public
|
like(string $x, mixed $y): string
Creates a LIKE() comparison expression with the given arguments.
Creates a LIKE() comparison expression with the given arguments.
Parameters
| $x |
The expression to be inspected by the LIKE comparison
|
| $y |
The pattern to compare against
|
|
#
|
public
|
notLike(string $x, mixed $y): string
Creates a NOT LIKE() comparison expression with the given arguments.
Creates a NOT LIKE() comparison expression with the given arguments.
Parameters
| $x |
The expression to be inspected by the NOT LIKE comparison
|
| $y |
The pattern to compare against
|
|
#
|
public
|
in(string $x, string|string[] $y): string
Creates an IN () comparison expression with the given arguments.
Creates an IN () comparison expression with the given arguments.
Parameters
| $x |
The SQL expression to be matched against the set.
|
| $y |
The SQL expression or an array of SQL expressions representing the set.
|
|
#
|
public
|
notIn(string $x, string|string[] $y): string
Creates a NOT IN () comparison expression with the given arguments.
Creates a NOT IN () comparison expression with the given arguments.
Parameters
| $x |
The SQL expression to be matched against the set.
|
| $y |
The SQL expression or an array of SQL expressions representing the set.
|
|
#
|
public
|
literal(mixed $input, int|null $type = null): string
Builds an SQL literal from a given input parameter.
Builds an SQL literal from a given input parameter.
The usage of this method is discouraged. Use prepared statements
or {@see AbstractPlatform::quoteStringLiteral()} instead.
Parameters
| $input |
The parameter to be quoted.
|
| $type |
The type of the parameter.
|
|
#
|