| Methods |
public
|
andX(Comparison|Func|Andx|Orx|string ...$x = null): Andx
Creates a conjunction of the given boolean expressions.
Creates a conjunction of the given boolean expressions.
Example:
[php]
// (u.type = ?1) AND (u.role = ?2)
$expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2'));
|
#
|
public
|
orX(Comparison|Func|Andx|Orx|string ...$x = null): Orx
Creates a disjunction of the given boolean expressions.
Creates a disjunction of the given boolean expressions.
Example:
[php]
// (u.type = ?1) OR (u.role = ?2)
$q->where($q->expr()->orX('u.type = ?1', 'u.role = ?2'));
|
#
|
public
|
asc(mixed $expr): OrderBy
Creates an ASCending order expression.
Creates an ASCending order expression.
|
#
|
public
|
desc(mixed $expr): OrderBy
Creates a DESCending order expression.
Creates a DESCending order expression.
|
#
|
public
|
eq(mixed $x, mixed $y): Comparison
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 = ?1
$expr->eq('u.id', '?1');
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
neq(mixed $x, mixed $y): Comparison
Creates an instance of Expr\Comparison, with the given arguments.
First argument is considered the left expression and…
Creates an instance of Expr\Comparison, 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 |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
lt(mixed $x, mixed $y): Comparison
Creates an instance of Expr\Comparison, with the given arguments.
First argument is considered the left expression and…
Creates an instance of Expr\Comparison, 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()->lt('u.id', '?1'));
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
lte(mixed $x, mixed $y): Comparison
Creates an instance of Expr\Comparison, with the given arguments.
First argument is considered the left expression and…
Creates an instance of Expr\Comparison, 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()->lte('u.id', '?1'));
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
gt(mixed $x, mixed $y): Comparison
Creates an instance of Expr\Comparison, with the given arguments.
First argument is considered the left expression and…
Creates an instance of Expr\Comparison, 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()->gt('u.id', '?1'));
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
gte(mixed $x, mixed $y): Comparison
Creates an instance of Expr\Comparison, with the given arguments.
First argument is considered the left expression and…
Creates an instance of Expr\Comparison, 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()->gte('u.id', '?1'));
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
avg(mixed $x): Func
Creates an instance of AVG() function, with the given argument.
Creates an instance of AVG() function, with the given argument.
Parameters
| $x |
Argument to be used in AVG() function.
|
|
#
|
public
|
max(mixed $x): Func
Creates an instance of MAX() function, with the given argument.
Creates an instance of MAX() function, with the given argument.
Parameters
| $x |
Argument to be used in MAX() function.
|
|
#
|
public
|
min(mixed $x): Func
Creates an instance of MIN() function, with the given argument.
Creates an instance of MIN() function, with the given argument.
Parameters
| $x |
Argument to be used in MIN() function.
|
|
#
|
public
|
count(mixed $x): Func
Creates an instance of COUNT() function, with the given argument.
Creates an instance of COUNT() function, with the given argument.
Parameters
| $x |
Argument to be used in COUNT() function.
|
|
#
|
public
|
countDistinct(mixed $x): string
Creates an instance of COUNT(DISTINCT) function, with the given argument.
Creates an instance of COUNT(DISTINCT) function, with the given argument.
Parameters
| $x |
Argument to be used in COUNT(DISTINCT) function.
|
|
#
|
public
|
exists(mixed $subquery): Func
Creates an instance of EXISTS() function, with the given DQL Subquery.
Creates an instance of EXISTS() function, with the given DQL Subquery.
Parameters
| $subquery |
DQL Subquery to be used in EXISTS() function.
|
|
#
|
public
|
all(mixed $subquery): Func
Creates an instance of ALL() function, with the given DQL Subquery.
Creates an instance of ALL() function, with the given DQL Subquery.
Parameters
| $subquery |
DQL Subquery to be used in ALL() function.
|
|
#
|
public
|
some(mixed $subquery): Func
Creates a SOME() function expression with the given DQL subquery.
Creates a SOME() function expression with the given DQL subquery.
Parameters
| $subquery |
DQL Subquery to be used in SOME() function.
|
|
#
|
public
|
any(mixed $subquery): Func
Creates an ANY() function expression with the given DQL subquery.
Creates an ANY() function expression with the given DQL subquery.
Parameters
| $subquery |
DQL Subquery to be used in ANY() function.
|
|
#
|
public
|
not(mixed $restriction): Func
Creates a negation expression of the given restriction.
Creates a negation expression of the given restriction.
Parameters
| $restriction |
Restriction to be used in NOT() function.
|
|
#
|
public
|
abs(mixed $x): Func
Creates an ABS() function expression with the given argument.
Creates an ABS() function expression with the given argument.
Parameters
| $x |
Argument to be used in ABS() function.
|
|
#
|
public
|
mod(mixed $x, mixed $y): Func
Creates a MOD($x, $y) function expression to return the remainder of $x divided by $y.
Creates a MOD($x, $y) function expression to return the remainder of $x divided by $y.
|
#
|
public
|
prod(mixed $x, mixed $y): Math
Creates a product mathematical expression with the given arguments.
Creates a product mathematical 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.salary * u.percentAnnualSalaryIncrease
$q->expr()->prod('u.salary', 'u.percentAnnualSalaryIncrease')
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
diff(mixed $x, mixed $y): Math
Creates a difference mathematical expression with the given arguments.
First argument is considered the left expression…
Creates a difference mathematical 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.monthlySubscriptionCount - 1
$q->expr()->diff('u.monthlySubscriptionCount', '1')
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
sum(mixed $x, mixed $y): Math
Creates a sum mathematical expression with the given arguments.
First argument is considered the left expression and…
Creates a sum mathematical 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.numChildren + 1
$q->expr()->sum('u.numChildren', '1')
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
quot(mixed $x, mixed $y): Math
Creates a quotient mathematical expression with the given arguments.
First argument is considered the left expression…
Creates a quotient mathematical 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.total / u.period
$expr->quot('u.total', 'u.period')
Parameters
| $x |
Left expression.
|
| $y |
Right expression.
|
|
#
|
public
|
sqrt(mixed $x): Func
Creates a SQRT() function expression with the given argument.
Creates a SQRT() function expression with the given argument.
Parameters
| $x |
Argument to be used in SQRT() function.
|
|
#
|
public
|
in(string $x, mixed $y): Func
Creates an IN() expression with the given arguments.
Creates an IN() expression with the given arguments.
Parameters
| $x |
Field in string format to be restricted by IN() function.
|
| $y |
Argument to be used in IN() function.
|
|
#
|
public
|
notIn(string $x, mixed $y): Func
Creates a NOT IN() expression with the given arguments.
Creates a NOT IN() expression with the given arguments.
Parameters
| $x |
Field in string format to be restricted by NOT IN() function.
|
| $y |
Argument to be used in NOT IN() function.
|
|
#
|
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 |
Field in string format 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 |
Field in string format to be restricted by IS NOT NULL.
|
|
#
|
public
|
like(string $x, mixed $y): Comparison
Creates a LIKE() comparison expression with the given arguments.
Creates a LIKE() comparison expression with the given arguments.
Parameters
| $x |
Field in string format to be inspected by LIKE() comparison.
|
| $y |
Argument to be used in LIKE() comparison.
|
|
#
|
public
|
notLike(string $x, mixed $y): Comparison
Creates a NOT LIKE() comparison expression with the given arguments.
Creates a NOT LIKE() comparison expression with the given arguments.
Parameters
| $x |
Field in string format to be inspected by LIKE() comparison.
|
| $y |
Argument to be used in LIKE() comparison.
|
|
#
|
public
|
concat(mixed $x, mixed $y): Func
Creates a CONCAT() function expression with the given arguments.
Creates a CONCAT() function expression with the given arguments.
Parameters
| $x |
First argument to be used in CONCAT() function.
|
| $y |
,... Other arguments to be used in CONCAT() function.
|
|
#
|
public
|
substring(mixed $x, int $from, int|null $len = null): Func
Creates a SUBSTRING() function expression with the given arguments.
Creates a SUBSTRING() function expression with the given arguments.
Parameters
| $x |
Argument to be used as string to be cropped by SUBSTRING() function.
|
| $from |
Initial offset to start cropping string. May accept negative values.
|
| $len |
Length of crop. May accept negative values.
|
|
#
|
public
|
lower(mixed $x): Func
Creates a LOWER() function expression with the given argument.
Creates a LOWER() function expression with the given argument.
Parameters
| $x |
Argument to be used in LOWER() function.
|
Returns
A LOWER function expression.
|
#
|
public
|
upper(mixed $x): Func
Creates an UPPER() function expression with the given argument.
Creates an UPPER() function expression with the given argument.
Parameters
| $x |
Argument to be used in UPPER() function.
|
Returns
An UPPER function expression.
|
#
|
public
|
length(mixed $x): Func
Creates a LENGTH() function expression with the given argument.
Creates a LENGTH() function expression with the given argument.
Parameters
| $x |
Argument to be used as argument of LENGTH() function.
|
Returns
A LENGTH function expression.
|
#
|
public
|
literal(scalar $literal): Literal
Creates a literal expression of the given argument.
Creates a literal expression of the given argument.
Parameters
| $literal |
Argument to be converted to literal.
|
|
#
|
private
|
quoteLiteral(scalar $literal): string
Quotes a literal value, if necessary, according to the DQL syntax.
Quotes a literal value, if necessary, according to the DQL syntax.
Parameters
| $literal |
The literal value.
|
|
#
|
public
|
between(mixed $val, int|string $x, int|string $y): string
Creates an instance of BETWEEN() function, with the given argument.
Creates an instance of BETWEEN() function, with the given argument.
Parameters
| $val |
Valued to be inspected by range values.
|
| $x |
Starting range value to be used in BETWEEN() function.
|
| $y |
End point value to be used in BETWEEN() function.
|
Returns
|
#
|
public
|
trim(mixed $x): Func
Creates an instance of TRIM() function, with the given argument.
Creates an instance of TRIM() function, with the given argument.
Parameters
| $x |
Argument to be used as argument of TRIM() function.
|
Returns
|
#
|
public
|
isMemberOf(string $x, string $y): Comparison
Creates an instance of MEMBER OF function, with the given arguments.
Creates an instance of MEMBER OF function, with the given arguments.
Parameters
| $x |
Value to be checked
|
| $y |
Value to be checked against
|
|
#
|
public
|
isInstanceOf(string $x, string $y): Comparison
Creates an instance of INSTANCE OF function, with the given arguments.
Creates an instance of INSTANCE OF function, with the given arguments.
Parameters
| $x |
Value to be checked
|
| $y |
Value to be checked against
|
|
#
|