當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。