Cake\Database\Query::valueBinder PHP Method

valueBinder() public method

A ValueBinder is responsible for generating query placeholders and temporarily associate values to those placeholders so that they can be passed correctly statement object.
public valueBinder ( ValueBinder | null $binder = null )
$binder ValueBinder | null new instance to be set. If no value is passed the default one will be returned
    public function valueBinder($binder = null)
    {
        if ($binder === null) {
            if ($this->_valueBinder === null) {
                $this->_valueBinder = new ValueBinder();
            }
            return $this->_valueBinder;
        }
        $this->_valueBinder = $binder;
        return $this;
    }

Usage Example

 /**
  * Iterates over each of the clauses in a query looking for identifiers and
  * quotes them
  *
  * @param Query $query The query to have its identifiers quoted
  * @return Query
  */
 public function quote(Query $query)
 {
     $binder = $query->valueBinder();
     $query->valueBinder(false);
     if ($query->type() === 'insert') {
         $this->_quoteInsert($query);
     } else {
         $this->_quoteParts($query);
     }
     $query->traverseExpressions([$this, 'quoteExpression']);
     $query->valueBinder($binder);
     return $query;
 }
All Usage Examples Of Cake\Database\Query::valueBinder