ExpressionBuilder¶
- 
class 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder¶ Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#44 Implements: OCP\DB\QueryBuilder\IExpressionBuilder
Properties¶
- 
protected static property 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::$expressionBuilder¶ Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#46 Type: \Doctrine\DBAL\Query\Expression\ExpressionBuilder
- 
protected static property 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::$helper¶ Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#49 Type: \OC\DB\QueryBuilder\QuoteHelper
- 
protected static property 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::$connection¶ Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#52 Type: \OCP\IDBConnection
- 
protected static property 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::$functionBuilder¶ Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#55 Type: \OC\DB\QueryBuilder\FunctionBuilder\FunctionBuilder
Methods¶
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::__construct($connection, $queryBuilder)¶ - Initializes a new <tt>ExpressionBuilder</tt>.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#63
Parameters: - $connection (
OC\DB\ConnectionAdapter) - $queryBuilder (
OCP\DB\QueryBuilder\IQueryBuilder) 
 - $connection (
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#84
Parameters: - $x (mixed) Optional clause. Defaults = null, but requires
 
at least one defined when converting to string.
Returns:  
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#103
Parameters: - $x (mixed) Optional clause. Defaults = null, but requires
 
at least one defined when converting to string.
Returns:  
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::comparison($x, $operator, $y, $type=null)¶ - Creates a comparison expression.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#142
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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#164
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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#186
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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#208
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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#230
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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::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/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#252
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
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::isNull($x)¶ - Creates an IS NULL expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#265
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
 - $x (string | 
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::isNotNull($x)¶ - Creates an IS NOT NULL expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#277
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
 - $x (string | 
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::like($x, $y, $type=null)¶ - Creates a LIKE() comparison expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#292
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
 - $x (
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::iLike($x, $y, $type=null)¶ - Creates a ILIKE() comparison expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#309
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 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::notLike($x, $y, $type=null)¶ - Creates a NOT LIKE() comparison expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#323
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
 - $x (
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::in($x, $y, $type=null)¶ - Creates a IN () comparison expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#339
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
 - $x (
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::notIn($x, $y, $type=null)¶ - Creates a NOT IN () comparison expression with the given arguments.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#355
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
 - $x (
 
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::emptyString($x)¶ - Creates a $x = ‘’ statement, because Oracle needs a different check
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#368
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 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::nonEmptyString($x)¶ - Creates a `$x <> ‘’` statement, because Oracle needs a different check
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#379
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 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::bitwiseAnd($x, $y)¶ - Binary AND Operator copies a bit to the result if it exists in both operands.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#391
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 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::bitwiseOr($x, $y)¶ - Binary OR Operator copies a bit if it exists in either operand.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#406
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 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::literal($input, $type=null)¶ - Quotes a given input parameter.
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#421
Parameters: - $input (mixed) The parameter to be quoted.
 - $type (mixed | null) One of the IQueryBuilder::PARAM_* constants
 
Returns:  
- 
public 
OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder::castColumn($column, $type)¶ - Returns a IQueryFunction that casts the column to the given type
Source: lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php#432
Parameters: - $column (string)
 - $type (mixed) One of IQueryBuilder::PARAM_*
 
Returns: