placeholder() public méthode

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
Résultat string to be used as a placeholder in a query expression
Exemple #1
0
 /**
  * Registers a value in the placeholder generator and returns the generated
  * placeholder
  *
  * @param \Cake\Database\ValueBinder $generator The value binder
  * @param mixed $value The value to bind
  * @param string $type The type to use
  * @return string generated placeholder
  */
 protected function _bindValue($generator, $value, $type)
 {
     $placeholder = $generator->placeholder('tuple');
     $generator->bind($placeholder, $value, $type);
     return $placeholder;
 }
 /**
  * Registers a value in the placeholder generator and returns the generated placeholder
  *
  * @param mixed $value
  * @param ValueBinder $generator
  * @param string $type
  * @return string generated placeholder
  */
 protected function _bindValue($value, $generator, $type)
 {
     $placeholder = $generator->placeholder($this->_field);
     $generator->bind($placeholder, $value, $type);
     return $placeholder;
 }