IExpressionBuilder¶
- 
interface 
OCP\DB\QueryBuilder\IExpressionBuilder¶ - This class provides a wrapper around Doctrine’s ExpressionBuilder
Implemented by: OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilderSource: 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: Parameters: - $x (mixed) Optional clause. Defaults = null, but requires
 
at least one defined when converting to string.
Returns: 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: Parameters: - $x (mixed) Optional clause. Defaults = null, but requires
 
at least one defined when converting to string.
Returns: Since: 8.2.0
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::comparison($x, $operator, $y, $type=null)¶ - Creates a comparison expression.
Source: 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: 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: 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: 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: 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: 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: 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: Parameters: - $x (string | 
\OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction) The field in string format to be restricted by IS NULL. 
Returns: string
Since: 8.2.0
 - $x (string | 
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::isNotNull($x)¶ - Creates an IS NOT NULL expression with the given arguments.
Source: Parameters: - $x (string | 
\OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction) The field in string format to be restricted by IS NOT NULL. 
Returns: string
Since: 8.2.0
 - $x (string | 
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::like($x, $y, $type=null)¶ - Creates a LIKE() comparison expression with the given arguments.
Source: Parameters: - $x (
OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction| string) Field in string format to be inspected by LIKE() comparison. - $y (mixed) Argument to be used in LIKE() comparison.
 - $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
 - $x (
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::notLike($x, $y, $type=null)¶ - Creates a NOT LIKE() comparison expression with the given arguments.
Source: Parameters: - $x (
OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\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) 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
 - $x (
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::iLike($x, $y, $type=null)¶ - Creates a ILIKE() comparison expression with the given arguments.
Source: 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: Parameters: - $x (
OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction| string) The field in string format to be inspected by IN() comparison. - $y (
OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction| string | array) The placeholder or the array of values to be used by IN() comparison. - $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
 - $x (
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::notIn($x, $y, $type=null)¶ - Creates a NOT IN () comparison expression with the given arguments.
Source: Parameters: - $x (
OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction| string) The field in string format to be inspected by NOT IN() comparison. - $y (
OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction| string | array) The placeholder or the array of values to be used by NOT IN() comparison. - $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
 - $x (
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::emptyString($x)¶ - Creates a $x = ‘’ statement, because Oracle needs a different check
Source: Parameters: - $x (string | 
\OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction) The field in string format to be inspected by the comparison. 
Returns: string
Since: 13.0.0
 - $x (string | 
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::nonEmptyString($x)¶ - Creates a `$x <> ‘’` statement, because Oracle needs a different check
Source: Parameters: - $x (string | 
\OCP\DB\QueryBuilder\ILiteral|\OCP\DB\QueryBuilder\IParameter|\OCP\DB\QueryBuilder\IQueryFunction) The field in string format to be inspected by the comparison. 
Returns: string
Since: 13.0.0
 - $x (string | 
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::bitwiseAnd($x, $y)¶ - Creates a bitwise AND comparison
Source: Parameters: - $x (string | 
\OCP\DB\QueryBuilder\ILiteral) The field or value to check - $y (int) Bitmap that must be set
 
Returns: Since: 12.0.0
 - $x (string | 
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::bitwiseOr($x, $y)¶ - Creates a bitwise OR comparison
Source: Parameters: - $x (string | 
\OCP\DB\QueryBuilder\ILiteral) The field or value to check - $y (int) Bitmap that must be set
 
Returns: Since: 12.0.0
 - $x (string | 
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::literal($input, $type=null)¶ - Quotes a given input parameter.
Source: Parameters: - $input (mixed) The parameter to be quoted.
 - $type (mixed | null) One of the IQueryBuilder::PARAM_* constants
 
Returns: Since: 8.2.0
 
- 
public 
OCP\DB\QueryBuilder\IExpressionBuilder::castColumn($column, $type)¶ - Returns a IQueryFunction that casts the column to the given type
Source: Parameters: - $column (string)
 - $type (mixed) One of IQueryBuilder::PARAM_*
 
Returns: Since: 9.0.0