PHP Class Cake\Database\Expression\TupleComparison

Inheritance: extends Cake\Database\Expression\Comparison
Exibir arquivo Open project: cakephp/cakephp Class Usage Examples

Public Methods

Method Description
__construct ( string | array $fields, array | Cake\Database\ExpressionInterface $values, array $types = [], string $conjunction = '=' ) Constructor
isMulti ( ) : boolean Determines if each of the values in this expressions is a tuple in itself
sql ( ValueBinder $generator ) : string Convert the expression into a SQL fragment.
traverse ( callable $callable ) : void Traverses the tree of expressions stored in this object, visiting first expressions in the left hand side and then the rest.

Protected Methods

Method Description
_bindValue ( ValueBinder $generator, mixed $value, string $type ) : string Registers a value in the placeholder generator and returns the generated placeholder
_stringifyValues ( ValueBinder $generator ) : string Returns a string with the values as placeholders in a string to be used for the SQL version of this expression
_traverseValue ( mixed $value, callable $callable ) : void Conditionally executes the callback for the passed value if it is an ExpressionInterface

Method Details

__construct() public method

Constructor
public __construct ( string | array $fields, array | Cake\Database\ExpressionInterface $values, array $types = [], string $conjunction = '=' )
$fields string | array the fields to use to form a tuple
$values array | Cake\Database\ExpressionInterface the values to use to form a tuple
$types array the types names to use for casting each of the values, only one type per position in the value array in needed
$conjunction string the operator used for comparing field and value

_bindValue() protected method

Registers a value in the placeholder generator and returns the generated placeholder
protected _bindValue ( ValueBinder $generator, mixed $value, string $type ) : string
$generator Cake\Database\ValueBinder The value binder
$value mixed The value to bind
$type string The type to use
return string generated placeholder

_stringifyValues() protected method

Returns a string with the values as placeholders in a string to be used for the SQL version of this expression
protected _stringifyValues ( ValueBinder $generator ) : string
$generator Cake\Database\ValueBinder The value binder to convert expressions with.
return string

_traverseValue() protected method

Conditionally executes the callback for the passed value if it is an ExpressionInterface
protected _traverseValue ( mixed $value, callable $callable ) : void
$value mixed The value to traverse
$callable callable The callable to use when traversing
return void

isMulti() public method

Determines if each of the values in this expressions is a tuple in itself
public isMulti ( ) : boolean
return boolean

sql() public method

Convert the expression into a SQL fragment.
public sql ( ValueBinder $generator ) : string
$generator Cake\Database\ValueBinder Placeholder generator object
return string

traverse() public method

Callback function receives as its only argument an instance of an ExpressionInterface
public traverse ( callable $callable ) : void
$callable callable The callable to apply to sub-expressions
return void