This expression represents SQL fragments that are used for comparing one tuple to another, one tuple to a set of other tuples or one tuple to an expression
Cake\Database\ExpressionInterface|array|stringThe field name or expression to be used in the left hand side of the operator
boolWhether the value in this expression is a traversable
stringThe operator used for comparing field and value
array<string|null>The type to be used for casting the value to a database representation
mixedThe value to be used in the right hand side of the operation
arrayCake\Database\ExpressionInterface>A cached list of ExpressionInterface objects that were found in the value for this expression.
Create a deep clone.
Constructor
Registers a value in the placeholder generator and returns the generated placeholder
Conditionally converts the passed value to an ExpressionInterface object if the type class implements the ExpressionTypeInterface. Otherwise, returns the value unmodified.
Returns an array with the original $values in the first position and all ExpressionInterface objects that could be found in the second position.
Converts a traversable value into a set of placeholders generated by $binder and separated by ,
Returns an array with the types that require values to be casted to expressions, out of the list of type names passed as parameter.
Returns a template and a placeholder for the value after registering it with the placeholder $binder
Returns a string with the values as placeholders in a string to be used for the SQL version of this expression
Conditionally executes the callback for the passed value if it is an ExpressionInterface
Returns the field name
Returns the operator used for comparison
Returns the type to be used for casting the value to a database representation
Returns the value used for comparison
Determines if each of the values in this expressions is a tuple in itself
Sets the field name
Sets the operator to use for the comparison
Sets the value
Converts the Node into a SQL string fragment.
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.
__clone(): void
Create a deep clone.
Clones the field and value if they are expression objects.
void__construct(Cake\Database\ExpressionInterface|array|string $fields, Cake\Database\ExpressionInterface|array $values, array<string|null> $types = [], string $conjunction = '=')
Constructor
Cake\Database\ExpressionInterface|array|string $fields the fields to use to form a tuple
Cake\Database\ExpressionInterface|array $values the values to use to form a tuple
array<string|null> $types optional the types names to use for casting each of the values, only one type per position in the value array in needed
string $conjunction optional the operator used for comparing field and value
_bindValue(mixed $value, Cake\Database\ValueBinder $binder, string|null $type = null): string
Registers a value in the placeholder generator and returns the generated placeholder
mixed $value Cake\Database\ValueBinder $binder string|null $type optional string_castToExpression(mixed $value, string|null $type = null): mixed
Conditionally converts the passed value to an ExpressionInterface object if the type class implements the ExpressionTypeInterface. Otherwise, returns the value unmodified.
mixed $value The value to convert to ExpressionInterface
string|null $type optional The type name
mixed_collectExpressions(Cake\Database\ExpressionInterface|iterable $values): array
Returns an array with the original $values in the first position and all ExpressionInterface objects that could be found in the second position.
Cake\Database\ExpressionInterface|iterable $values The rows to insert
array_flattenValue(iterable $value, Cake\Database\ValueBinder $binder, string|null $type = null): string
Converts a traversable value into a set of placeholders generated by $binder and separated by ,
iterable $value the value to flatten
Cake\Database\ValueBinder $binder The value binder to use
string|null $type optional the type to cast values to
string_requiresToExpressionCasting(array $types): array
Returns an array with the types that require values to be casted to expressions, out of the list of type names passed as parameter.
array $types List of type names
array_stringExpression(Cake\Database\ValueBinder $binder): array
Returns a template and a placeholder for the value after registering it with the placeholder $binder
Cake\Database\ValueBinder $binder The value binder to use.
array_stringifyValues(Cake\Database\ValueBinder $binder): string
Returns a string with the values as placeholders in a string to be used for the SQL version of this expression
Cake\Database\ValueBinder $binder The value binder to convert expressions with.
string_traverseValue(mixed $value, Closure $callback): void
Conditionally executes the callback for the passed value if it is an ExpressionInterface
mixed $value The value to traverse
Closure $callback The callable to use when traversing
voidgetField(): Cake\Database\ExpressionInterface|array|string
Returns the field name
Cake\Database\ExpressionInterface|array|stringgetOperator(): string
Returns the operator used for comparison
stringgetType(): array<string|null>
Returns the type to be used for casting the value to a database representation
array<string|null>getValue(): mixed
Returns the value used for comparison
mixedisMulti(): bool
Determines if each of the values in this expressions is a tuple in itself
boolsetField(Cake\Database\ExpressionInterface|array|string $field): void
Sets the field name
Cake\Database\ExpressionInterface|array|string $field The field to compare with.
voidsetOperator(string $operator): void
Sets the operator to use for the comparison
string $operator The operator to be used for the comparison.
voidsetValue(mixed $value): void
Sets the value
mixed $value The value to compare
voidsql(Cake\Database\ValueBinder $binder): string
Converts the Node into a SQL string fragment.
Cake\Database\ValueBinder $binder stringtraverse(Closure $callback): $this
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.
Closure $callback $thisThe field name or expression to be used in the left hand side of the operator
Cake\Database\ExpressionInterface|array|stringWhether the value in this expression is a traversable
boolThe operator used for comparing field and value
stringThe type to be used for casting the value to a database representation
array<string|null>The value to be used in the right hand side of the operation
mixedA cached list of ExpressionInterface objects that were found in the value for this expression.
arrayCake\Database\ExpressionInterface>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Database.Expression.TupleComparison.html