An expression object that represents a SQL BETWEEN snippet
string|array|\Cake\Database\ExpressionInterface
The field name or expression to be used in the left hand side of the operator
mixed
The first value in the expression
mixed
The second value in the expression
mixed
The data type for the from and to arguments
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 types that require values to be casted to expressions, out of the list of type names passed as parameter.
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $visitor callable passing as first parameter the instance of the expression currently being iterated.
__clone()
Do a deep clone of this expression.
__construct(mixed $field, mixed $from, mixed $to, mixed $type)
Constructor
string|\Cake\Database\ExpressionInterface
$field The field name to compare for values inbetween the range.
mixed
$from The initial value of the range.
mixed
$to The ending value in the comparison range.
string|null
$type optional The data type name to bind the values with.
_bindValue(mixed $value, mixed $generator, mixed $type)
Registers a value in the placeholder generator and returns the generated placeholder
mixed
$value The value to bind
\Cake\Database\ValueBinder
$generator The value binder to use
string
$type The type of $value
string
generated placeholder
_castToExpression(mixed $value, ?string $type)
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 converto to ExpressionInterface
string|null
$type optional The type name
mixed
_requiresToExpressionCasting(array $types)
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
getField()
Returns the field name
string|array|\Cake\Database\ExpressionInterface
setField(mixed $field)
Sets the field name
string|array|\Cake\Database\ExpressionInterface
$field The field to compare with.
sql(\Cake\Database\ValueBinder $generator)
Converts the expression to its string representation
\Cake\Database\ValueBinder
$generator Placeholder generator object
string
traverse(\Closure $visitor)
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $visitor callable passing as first parameter the instance of the expression currently being iterated.
\Closure
$visitor The callable to apply to all nodes.
$this
The field name or expression to be used in the left hand side of the operator
string|array|\Cake\Database\ExpressionInterface
The first value in the expression
mixed
The second value in the expression
mixed
The data type for the from and to arguments
mixed
© 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.1/class-Cake.Database.Expression.BetweenExpression.html