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


PHP MongoCursor::rewind方法代码示例

本文整理汇总了PHP中MongoCursor::rewind方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoCursor::rewind方法的具体用法?PHP MongoCursor::rewind怎么用?PHP MongoCursor::rewind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MongoCursor的用法示例。


在下文中一共展示了MongoCursor::rewind方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rewind

 /**
  * @throws Exception\RuntimeException
  * @return void
  */
 public function rewind()
 {
     //        if ( $this -> statementMode == self::STATEMENT_MODE_FORWARD && $this -> position > 0 )
     //        {
     //            throw new Exception\RuntimeException(
     //            'This result is a forward only result set, calling rewind() after moving forward is not supported'
     //            );
     //        }
     $this->resource->rewind();
     $this->currentData = $this->resource->current();
     $this->currentComplete = true;
     $this->position = 0;
 }
开发者ID:pasechnik,项目名称:mongozend,代码行数:17,代码来源:Result.php

示例2: getCursor

 /**
  *
  * @return \MongoCursor
  */
 private function getCursor()
 {
     if ($this->cursor) {
         return $this->cursor;
     }
     $this->cursor = $this->collection->getMongoCollection()->find($this->expression->toArray(), $this->fields);
     if ($this->skip) {
         $this->cursor->skip($this->skip);
     }
     if ($this->limit) {
         $this->cursor->limit($this->limit);
     }
     if ($this->options['batchSize']) {
         $this->cursor->batchSize($this->options['batchSize']);
     }
     if ($this->options['clientTimeout']) {
         $this->cursor->timeout($this->options['clientTimeout']);
     }
     if ($this->options['serverTimeout']) {
         $this->cursor->maxTimeMS($this->options['clientTimeout']);
     }
     if ($this->sort) {
         $this->cursor->sort($this->sort);
     }
     if ($this->hint) {
         $this->cursor->hint($this->hint);
     }
     // log request
     if ($this->client->hasLogger()) {
         $this->client->getLogger()->debug(get_called_class() . ': ' . json_encode(array('collection' => $this->collection->getName(), 'query' => $this->expression->toArray(), 'project' => $this->fields, 'sort' => $this->sort)));
     }
     $this->cursor->rewind();
     // define read preferences
     if ($this->readPreference) {
         $this->cursor->setReadPreference($this->readPreference['type'], $this->readPreference['tagsets']);
     }
     return $this->cursor;
 }
开发者ID:paulocarvalhodesign,项目名称:php-mongo,代码行数:42,代码来源:Cursor.php

示例3: rewind

 /**
  * Rewind the Iterator to the first element
  * @return void
  * @since v1.3.4
  */
 public function rewind()
 {
     $this->_cursor->rewind();
 }
开发者ID:phiphi1992,项目名称:alongaydep,代码行数:9,代码来源:EMongoCursor.php

示例4: rewind

 /**
  * Reset the MongoCursor to the beginning
  * @return EMongoCursor
  */
 public function rewind()
 {
     $this->cursor->rewind();
     return $this;
 }
开发者ID:sammaye,项目名称:mongoyii-php7,代码行数:9,代码来源:Cursor.php

示例5: rewind

 /**
  * Required for Iterator Interface
  * Runs the query on the database and rewinds the cursor to
  */
 public function rewind()
 {
     $this->runQry();
     $this->cursor->rewind();
 }
开发者ID:FNVI,项目名称:todo-example,代码行数:9,代码来源:Cursor.php

示例6: rewind

 /**
  * {@inheritdoc}
  */
 public function rewind()
 {
     $this->mongoCursor->rewind();
 }
开发者ID:dav-m85,项目名称:simple-mongo,代码行数:7,代码来源:Cursor.php

示例7: rewind

 /**
  * rewind.
  */
 public function rewind()
 {
     $this->logQuery();
     return parent::rewind();
 }
开发者ID:hybr,项目名称:jpm,代码行数:8,代码来源:LoggableMongoCursor.php

示例8: rewind

 /**
  * Iterator::rewind
  */
 public function rewind()
 {
     $this->myResultCursor->rewind();
 }
开发者ID:ppetermann,项目名称:king23,代码行数:7,代码来源:Result.php

示例9: rewind

 /**
  * Iterator interface rewind (used in foreach)
  *
  */
 public function rewind()
 {
     $this->cursor->rewind();
     $this->position = 0;
 }
开发者ID:irto,项目名称:neomongo,代码行数:9,代码来源:OdmCursor.php

示例10: rewind

 /**
  * 把游标指到第一条记录
  * @return null
  */
 public function rewind()
 {
     return $this->oMongoCursor->rewind();
 }
开发者ID:diandengs,项目名称:RechoPHP,代码行数:8,代码来源:class.Mumongo.php


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