IExpressionBuilder

interface OCP\DB\QueryBuilder\IExpressionBuilder
This class provides a wrapper around Doctrine’s ExpressionBuilder
Implemented by:OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#38

Constants

EQ = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::EQ
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#42
Since:9.0.0
NEQ = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::NEQ
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#46
Since:9.0.0
LT = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::LT
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#50
Since:9.0.0
LTE = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::LTE
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#54
Since:9.0.0
GT = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::GT
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#58
Since:9.0.0
GTE = \Doctrine\DBAL\Query\Expression\ExpressionBuilder::GTE
Source:lib/public/DB/QueryBuilder/IExpressionBuilder.php#62
Since:9.0.0

Methods

public OCP\DB\QueryBuilder\IExpressionBuilder::andX(...$x)
Creates a conjunction of the given boolean expressions.
Example:

[php]
// (u.type = ?) AND (u.role = ?)
$expr->andX(‘u.type = ?’, ‘u.role = ?’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#81

Parameters:
  • $x (mixed) Optional clause. Defaults = null, but requires

at least one defined when converting to string.

Returns:

\OCP\DB\QueryBuilder\ICompositeExpression

Since:

8.2.0

public OCP\DB\QueryBuilder\IExpressionBuilder::orX(...$x)
Creates a disjunction of the given boolean expressions.
Example:

[php]
// (u.type = ?) OR (u.role = ?)
$qb->where($qb->expr()->orX(‘u.type = ?’, ‘u.role = ?’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#100

Parameters:
  • $x (mixed) Optional clause. Defaults = null, but requires

at least one defined when converting to string.

Returns:

\OCP\DB\QueryBuilder\ICompositeExpression

Since:

8.2.0

public OCP\DB\QueryBuilder\IExpressionBuilder::comparison($x, $operator, $y, $type=null)
Creates a comparison expression.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#119

Parameters:
  • $x (mixed) The left expression.
  • $operator (string) One of the IExpressionBuilder::* constants.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::eq($x, $y, $type=null)
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 <left expr> = <right expr>. Example:

[php]
// u.id = ?
$expr->eq(‘u.id’, ‘?’);
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#143

Parameters:
  • $x (mixed) The left expression.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::neq($x, $y, $type=null)
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 <left expr> <> <right expr>. Example:

[php]
// u.id <> 1
$q->where($q->expr()->neq(‘u.id’, ‘1’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#166

Parameters:
  • $x (mixed) The left expression.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::lt($x, $y, $type=null)
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 <left expr> < <right expr>. Example:

[php]
// u.id < ?
$q->where($q->expr()->lt(‘u.id’, ‘?’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#189

Parameters:
  • $x (mixed) The left expression.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::lte($x, $y, $type=null)
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 <left expr> <= <right expr>. Example:

[php]
// u.id <= ?
$q->where($q->expr()->lte(‘u.id’, ‘?’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#212

Parameters:
  • $x (mixed) The left expression.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::gt($x, $y, $type=null)
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 <left expr> > <right expr>. Example:

[php]
// u.id > ?
$q->where($q->expr()->gt(‘u.id’, ‘?’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#235

Parameters:
  • $x (mixed) The left expression.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::gte($x, $y, $type=null)
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 <left expr> >= <right expr>. Example:

[php]
// u.id >= ?
$q->where($q->expr()->gte(‘u.id’, ‘?’));
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#258

Parameters:
  • $x (mixed) The left expression.
  • $y (mixed) The right expression.
  • $type (mixed | null) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::isNull($x)
Creates an IS NULL expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#270

Parameters:
Returns:

string

Since:

8.2.0

public OCP\DB\QueryBuilder\IExpressionBuilder::isNotNull($x)
Creates an IS NOT NULL expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#282

Parameters:
Returns:

string

Since:

8.2.0

public OCP\DB\QueryBuilder\IExpressionBuilder::like($x, $y, $type=null)
Creates a LIKE() comparison expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#299

Parameters:

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::notLike($x, $y, $type=null)
Creates a NOT LIKE() comparison expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#316

Parameters:

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::iLike($x, $y, $type=null)
Creates a ILIKE() comparison expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#333

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) one of the IQueryBuilder::PARAM_* constants

required when comparing text fields for oci compatibility

Returns:

string

Since:

9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::in($x, $y, $type=null)
Creates a IN () comparison expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#350

Parameters:

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::notIn($x, $y, $type=null)
Creates a NOT IN () comparison expression with the given arguments.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#367

Parameters:

required when comparing text fields for oci compatibility

Returns:

string

Since:

8.2.0 - Parameter $type was added in 9.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::emptyString($x)
Creates a $x = ‘’ statement, because Oracle needs a different check
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#378

Parameters:
Returns:

string

Since:

13.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::nonEmptyString($x)
Creates a `$x <> ‘’` statement, because Oracle needs a different check
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#389

Parameters:
Returns:

string

Since:

13.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::bitwiseAnd($x, $y)
Creates a bitwise AND comparison
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#403

Parameters:
Returns:

\OCP\DB\QueryBuilder\IQueryFunction

Since:

12.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::bitwiseOr($x, $y)
Creates a bitwise OR comparison
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#416

Parameters:
Returns:

\OCP\DB\QueryBuilder\IQueryFunction

Since:

12.0.0

public OCP\DB\QueryBuilder\IExpressionBuilder::literal($input, $type=null)
Quotes a given input parameter.
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#430

Parameters:
  • $input (mixed) The parameter to be quoted.
  • $type (mixed | null) One of the IQueryBuilder::PARAM_* constants
Returns:

\OCP\DB\QueryBuilder\ILiteral

Since:

8.2.0

public OCP\DB\QueryBuilder\IExpressionBuilder::castColumn($column, $type)
Returns a IQueryFunction that casts the column to the given type
Source:

lib/public/DB/QueryBuilder/IExpressionBuilder.php#443

Parameters:
  • $column (string)
  • $type (mixed) One of IQueryBuilder::PARAM_*
Returns:

\OCP\DB\QueryBuilder\IQueryFunction

Since:

9.0.0