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
Registers a value in the placeholder generator and returns the generated placeholder
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
Determines if each of the values in this expressions is a tuple in itself
Traverses the tree of expressions stored in this object, visiting first expressions in the left hand side and then the rest.
__construct( string|array|Cake\Database\ExpressionInterface $fields , array|Cake\Database\ExpressionInterface $values , array $types [] , string $conjunction '=' )
Constructor
Cake\Database\ExpressionInterface $fields Cake\Database\ExpressionInterface $values $types optional [] the types names to use for casting each of the values, only one type per position in the value array in needed
$conjunction optional '=' Cake\Database\Expression\Comparison::__construct() _bindValue( Cake\Database\ValueBinder $generator , mixed $value , string $type )
Registers a value in the placeholder generator and returns the generated placeholder
$generator $value $type Cake\Database\Expression\Comparison::_bindValue() _stringifyValues( Cake\Database\ValueBinder $generator )
Returns a string with the values as placeholders in a string to be used for the SQL version of this expression
$generator _traverseValue( mixed $value , callable $callable )
Conditionally executes the callback for the passed value if it is an ExpressionInterface
$value $callable isMulti( )
Determines if each of the values in this expressions is a tuple in itself
sql( Cake\Database\ValueBinder $generator )
Convert the expression into a SQL fragment.
$generator Cake\Database\Expression\Comparison::sql() traverse( callable $callable )
Traverses the tree of expressions stored in this object, visiting first expressions in the left hand side and then the rest.
Callback function receives as its only argument an instance of an ExpressionInterface
$callable Cake\Database\Expression\Comparison::traverse() __clone( )
Create a deep clone.
Clones the field and value if they are expression objects.
_collectExpressions( array|Traversable $values )
Returns an array with the original $values in the first position and all ExpressionInterface objects that could be found in the second position.
$values _flattenValue( array|Traversable $value , Cake\Database\ValueBinder $generator , string|array|null $type 'string' )
Converts a traversable value into a set of placeholders generated by $generator and separated by ,
$value $generator $type optional 'string' _stringExpression( Cake\Database\ValueBinder $generator )
Returns a template and a placeholder for the value after registering it with the placeholder $generator
$generator setOperator( string $operator )
Sets the operator to use for the comparison
$operator setValue( mixed $value )
Sets the value
$value _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.
$value $type _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.
$types getField( )
Returns the field name
Cake\Database\ExpressionInterfacesetField( string|Cake\Database\ExpressionInterface $field )
Sets the field name
Cake\Database\ExpressionInterface $field
© 2005–2018 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/3.5/class-Cake.Database.Expression.TupleComparison.html