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


PHP MongoCursor::getNext方法代码示例

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


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

示例1: getNext

 /**
  * Retrieve the collection object (as provided by x::find())
  * @return Collection
  */
 public function getNext()
 {
     $item = $this->cursor->getNext();
     $obj = clone $this->collection;
     $obj->populate($item);
     return $obj;
 }
开发者ID:rogerthomas84,项目名称:ohdm,代码行数:11,代码来源:Cursor.php

示例2: getNext

 /**
  * Get next doc in cursor
  * @return EMongoDocument|null
  */
 public function getNext()
 {
     if ($c = $this->cursor->getNext()) {
         return $this->current = $this->model->populateRecord($c, true, $this->partial);
     }
     return null;
 }
开发者ID:sammaye,项目名称:mongoyii-php7,代码行数:11,代码来源:Cursor.php

示例3: initializeNextItem

 /**
  * Ensures that the <code>next</code> points to the correct item, possibly reading from the dbCursor.
  */
 private function initializeNextItem()
 {
     while (!$this->messagesToReturn->valid() && $this->dbCursor->hasNext()) {
         $cb = $this->callback;
         $this->messagesToReturn = new \ArrayIterator($cb($this->dbCursor->getNext(), $this->actualAggregateIdentifier));
     }
     $this->next = $this->messagesToReturn->current();
     $this->messagesToReturn->next();
 }
开发者ID:fcm,项目名称:GovernorFramework,代码行数:12,代码来源:CursorBackedDomainEventStream.php

示例4: next

 /**
  * Query termination method (Will execute the query)
  * @return mixed
  */
 public function next()
 {
     if (!$this->_Cursor) {
         $this->_do_query();
     }
     if ($this->_Cursor && $this->_Cursor->hasNext()) {
         $document = $this->_Cursor->getNext();
         $this->_callback($document);
         return $document;
     }
 }
开发者ID:alex-robert,项目名称:knot,代码行数:15,代码来源:Findr.php

示例5: as_array

 public function as_array($key = null, $value = null)
 {
     $return_value = array();
     while ($data = parent::getNext()) {
         if ($key === null && $value === null) {
             $return_value[] = $this->load_model($data);
         } elseif ($key === null) {
             if (array_key_exists($value, $data)) {
                 $return_value[] = $data[$value];
             }
         } elseif ($value === null) {
             if (array_key_exists($key, $data)) {
                 $return_value[$data[$key]] = $this->load_model($data);
             }
         } else {
             if (array_key_exists($key, $data) && array_key_exists($value, $data)) {
                 $return_value[(string) $data[$key]] = $data[(string) $value];
             }
         }
     }
     return $return_value;
 }
开发者ID:doorframework,项目名称:core,代码行数:22,代码来源:Cursor.php

示例6: fetchRowsInternal

 /**
  * @param \MongoCursor $cursor Mongo cursor instance to fetch data from.
  * @param boolean $all whether to fetch all rows or only first one.
  * @param string|callable $indexBy value to index by.
  * @return array|boolean result.
  * @see Query::fetchRows()
  */
 protected function fetchRowsInternal($cursor, $all, $indexBy)
 {
     $result = [];
     if ($all) {
         foreach ($cursor as $row) {
             $result[] = $row;
         }
     } else {
         if ($row = $cursor->getNext()) {
             $result = $row;
         } else {
             $result = false;
         }
     }
     return $result;
 }
开发者ID:aayaresko,项目名称:yii2-extended-mongodb,代码行数:23,代码来源:Query.php

示例7: fetchRowsInternal

 /**
  * @param \MongoCursor $cursor Mongo cursor instance to fetch data from.
  * @param boolean $all whether to fetch all rows or only first one.
  * @param string|callable $indexBy value to index by.
  * @return array|boolean result.
  * @see Query::fetchRows()
  */
 protected function fetchRowsInternal($cursor, $all, $indexBy)
 {
     $result = [];
     if ($all) {
         foreach ($cursor as $row) {
             if ($indexBy !== null) {
                 if (is_string($indexBy)) {
                     $key = $row[$indexBy];
                 } else {
                     $key = call_user_func($indexBy, $row);
                 }
                 $result[$key] = $row;
             } else {
                 $result[] = $row;
             }
         }
     } else {
         if ($cursor->hasNext()) {
             $result = $cursor->getNext();
         } else {
             $result = false;
         }
     }
     return $result;
 }
开发者ID:howq,项目名称:yii2,代码行数:32,代码来源:Query.php

示例8: setCursor

 /**
  *  Set Cursor
  *
  *  This method receive a MongoCursor and make
  *  it iterable. 
  *
  *  @param MongoCursor $obj 
  *
  *  @return void
  */
 protected final function setCursor(MongoCursor $obj)
 {
     $this->_cursor = $obj;
     $obj->reset();
     $this->setResult($obj->getNext());
 }
开发者ID:284099857,项目名称:ActiveMongo,代码行数:16,代码来源:ActiveMongo.php

示例9: getNext

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

示例10: instantiateRecordClass

 /**
  * Assign every retrived record with collection's recordClass.
  *
  * @param \MongoCursor $cursor
  */
 private function instantiateRecordClass(\MongoCursor $cursor)
 {
     $recordClass = $this->recordClass();
     switch ($recordClass) {
         case null:
             while ($cursor->hasNext()) {
                 (yield $cursor->getNext());
             }
             break;
         default:
             while ($cursor->hasNext()) {
                 (yield new $recordClass($cursor->getNext()));
             }
             break;
     }
 }
开发者ID:serkin,项目名称:mongoob,代码行数:21,代码来源:AbstractCollection.php

示例11: getNext

 /**
  * Return the next object to which this cursor points, and advance the cursor
  *
  * @throws \MongoConnectionException
  * @throws \MongoCursorTimeoutException
  * @return modelBase Returns the next object
  */
 public function getNext()
 {
     $modelClass = $this->modelClass;
     $item = $this->cursor->getNext();
     return isset($item) ? new $modelClass($item) : null;
 }
开发者ID:mpcmf,项目名称:mpcmf-core,代码行数:13,代码来源:modelCursor.php

示例12: getNext

 /**
  * Return the next file to which this cursor points, and advance the cursor
  *
  * @return MongoGridFSFile - Returns the next file.
  */
 public function getNext()
 {
     parent::getNext();
     return $this->current();
 }
开发者ID:Wynncraft,项目名称:mongofill,代码行数:10,代码来源:MongoGridFSCursor.php

示例13: getNext

 /**
  * 获取下一个值,并且把游标移动
  * @return Array
  */
 public function getNext()
 {
     return $this->oMongoCursor->getNext();
 }
开发者ID:diandengs,项目名称:RechoPHP,代码行数:8,代码来源:class.Mumongo.php


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