本文整理汇总了PHP中Cake\Database\Query::bufferResults方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::bufferResults方法的具体用法?PHP Query::bufferResults怎么用?PHP Query::bufferResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Database\Query
的用法示例。
在下文中一共展示了Query::bufferResults方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
/**
* Prepares a sql statement to be executed
*
* @param string|\Cake\Database\Query $query The query to prepare.
* @return \Cake\Database\StatementInterface
*/
public function prepare($query)
{
$this->connect();
$options = [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL];
$isObject = $query instanceof Query;
if ($isObject && $query->bufferResults() === false) {
$options = [];
}
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query, $options);
return new SqlserverStatement($statement, $this);
}
示例2: prepare
/**
* Prepares a sql statement to be executed
*
* @param string|\Cake\Database\Query $query The query to prepare.
* @return \Cake\Database\StatementInterface
*/
public function prepare($query)
{
$this->connect();
$options = [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY];
$isObject = $query instanceof Query;
if ($isObject && $query->bufferResults() === false) {
$options = [];
}
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query, $options);
$result = new CustomSqlserverStatement(new SqlserverStatement($statement, $this), $this);
if ($isObject && $query->bufferResults() === false) {
$result->bufferResults(false);
}
return $result;
}
示例3: prepare
/**
* Prepares a sql statement to be executed
*
* @param string|\Cake\Database\Query $query The query to prepare.
* @return \Cake\Database\StatementInterface
*/
public function prepare($query)
{
$this->connect();
$isObject = $query instanceof Query;
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query);
$result = new SqliteStatement(new PDOStatement($statement, $this), $this);
if ($isObject && $query->bufferResults() === false) {
$result->bufferResults(false);
}
return $result;
}
示例4: prepare
/**
* Prepares a sql statement to be executed
*
* @param string|\Cake\Database\Query $query The query to convert into a statement.
* @return \Cake\Database\StatementInterface
*/
public function prepare($query)
{
$this->connect();
$isObject = $query instanceof \Cake\ORM\Query || $query instanceof \Cake\Database\Query;
$queryStringRaw = $isObject ? $query->sql() : $query;
Log::write('debug', $queryStringRaw);
// debug($queryStringRaw);
$queryString = $this->_fromDualIfy($queryStringRaw);
list($queryString, $paramMap) = self::convertPositionalToNamedPlaceholders($queryString);
$innerStatement = $this->_connection->prepare($queryString);
$statement = $this->_wrapStatement($innerStatement);
$statement->queryString = $queryStringRaw;
$statement->paramMap = $paramMap;
$disableBuffer = false;
$normalizedQuery = substr(strtolower(trim($queryString, " \t\n\r\v(")), 0, 6);
if ($normalizedQuery !== 'select') {
$disableBuffer = true;
}
if ($isObject && $query->bufferResults() === false || $disableBuffer) {
$statement->bufferResults(false);
}
return $statement;
}