PHP Класс Cake\Database\ValueBinder

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_bindings array Array containing a list of bound values to the conditions on this object. Each array entry is another array structure containing the actual bound value, its type and the placeholder it is bound to.
$_bindingsCount integer A counter of the number of parameters bound in this expression object

Открытые методы

Метод Описание
attachTo ( Cake\Database\StatementInterface $statement ) : void Binds all the stored values in this object to the passed statement.
bind ( string | integer $param, mixed $value, string | integer $type = 'string' ) : void Associates a query placeholder to a value and a type
bindings ( ) : array Returns all values bound to this expression object at this nesting level.
generateManyNamed ( array | Traversable $values, string $type = 'string' ) : array Creates unique named placeholders for each of the passed values and binds them with the specified type.
placeholder ( string $token ) : string Creates a unique placeholder name if the token provided does not start with ":" otherwise, it will return the same string and internally increment the number of placeholders generated by this object.
reset ( ) : void Clears any bindings that were previously registered
resetCount ( ) : void Resets the bindings count without clearing previously bound values

Описание методов

attachTo() публичный Метод

Binds all the stored values in this object to the passed statement.
public attachTo ( Cake\Database\StatementInterface $statement ) : void
$statement Cake\Database\StatementInterface The statement to add parameters to.
Результат void

bind() публичный Метод

Associates a query placeholder to a value and a type
public bind ( string | integer $param, mixed $value, string | integer $type = 'string' ) : void
$param string | integer placeholder to be replaced with quoted version of $value
$value mixed The value to be bound
$type string | integer the mapped type name, used for casting when sending to database
Результат void

bindings() публичный Метод

Subexpression bound values will not be returned with this function.
public bindings ( ) : array
Результат array

generateManyNamed() публичный Метод

Creates unique named placeholders for each of the passed values and binds them with the specified type.
public generateManyNamed ( array | Traversable $values, string $type = 'string' ) : array
$values array | Traversable The list of values to be bound
$type string The type with which all values will be bound
Результат array with the placeholders to insert in the query

placeholder() публичный Метод

Creates a unique placeholder name if the token provided does not start with ":" otherwise, it will return the same string and internally increment the number of placeholders generated by this object.
public placeholder ( string $token ) : string
$token string string from which the placeholder will be derived from, if it starts with a colon, then the same string is returned
Результат string to be used as a placeholder in a query expression

reset() публичный Метод

Clears any bindings that were previously registered
public reset ( ) : void
Результат void

resetCount() публичный Метод

Resets the bindings count without clearing previously bound values
public resetCount ( ) : void
Результат void

Описание свойств

$_bindings защищенное свойство

Array containing a list of bound values to the conditions on this object. Each array entry is another array structure containing the actual bound value, its type and the placeholder it is bound to.
protected array $_bindings
Результат array

$_bindingsCount защищенное свойство

A counter of the number of parameters bound in this expression object
protected int $_bindingsCount
Результат integer