本文整理汇总了PHP中Cake\Database\Query::valueBinder方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::valueBinder方法的具体用法?PHP Query::valueBinder怎么用?PHP Query::valueBinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Database\Query
的用法示例。
在下文中一共展示了Query::valueBinder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quote
/**
* 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;
}
示例2: run
/**
* Executes the provided query after compiling it for the specific dirver
* dialect and returns the executed Statement object.
*
* @param \Cake\Database\Query $query The query to be executed
* @return \Cake\Database\StatementInterface executed statement
*/
public function run(Query $query)
{
$binder = $query->valueBinder();
$binder->resetCount();
list($query, $sql) = $this->driver()->compileQuery($query, $binder);
$statement = $this->prepare($sql);
$binder->attachTo($statement);
$statement->execute();
return $statement;
}