当前位置: 首页>>代码示例>>PHP>>正文


PHP Query::bufferResults方法代码示例

本文整理汇总了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);
 }
开发者ID:CakeDC,项目名称:cakephp,代码行数:17,代码来源:Sqlserver.php

示例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;
 }
开发者ID:dominic-horbas,项目名称:cakephp-remote-sql-server-driver,代码行数:21,代码来源:CustomSqlserver.php

示例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;
 }
开发者ID:CakeDC,项目名称:cakephp,代码行数:17,代码来源:Sqlite.php

示例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;
 }
开发者ID:cakedc,项目名称:cakephp-oracle-driver,代码行数:29,代码来源:OracleBase.php


注:本文中的Cake\Database\Query::bufferResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。