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


PHP MongoCursor::current方法代码示例

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


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

示例1: current

 /**
  * Return the current element
  * @return EMongoDocument
  * @since v1.3.4
  */
 public function current()
 {
     $document = $this->_cursor->current();
     if (empty($document)) {
         return $document;
     }
     return $this->_model->populateRecord($document);
 }
开发者ID:phiphi1992,项目名称:alongaydep,代码行数:13,代码来源:EMongoCursor.php

示例2: current

 /**
  * (PHP 5 &gt;= 5.0.0)<br/>
  * Return the current element
  * @link http://php.net/manual/en/iterator.current.php
  * @return mixed Can return any type.
  */
 public function current()
 {
     $collection = clone $this->collectionInstance;
     $collection->writeAttributes((array) $this->cursor->current());
     if ($this->fields) {
         $collection->setCursorFields($this->fields);
     }
     if ($collection::isLazyLoadingEnabled()) {
         $proxyClass = ProxyBuilder::getLazyLoadingClass(get_class($collection), Di::getDefault());
         ProxyBuilder::assignProxyValues($proxyClass, $collection);
         $collection = $proxyClass;
     } else {
         $collection->map();
     }
     return $collection;
 }
开发者ID:vegas-cmf,项目名称:odm,代码行数:22,代码来源:LazyLoadingCursor.php

示例3: current

 /**
  * Returns the current element
  * 
  * @return array|object
  */
 public function current()
 {
     $values = parent::current();
     if (isset($values) && isset($this->collection) && $this->collection->getDocumentClass()) {
         $values = $this->collection->asDocument($values, $this->lazy);
     }
     return $values;
 }
开发者ID:jasny,项目名称:db-mongo,代码行数:13,代码来源:Cursor.php

示例4: current

 public function current()
 {
     if ($this->collectionName === null) {
         return new $this->objectType(parent::current());
     } else {
         return new $this->objectType($this->collectionName, parent::current());
     }
 }
开发者ID:photon,项目名称:storage-mongodb-object,代码行数:8,代码来源:ObjectIterator.php

示例5: current

 /**
  * Gets the active record for the current row
  * @return EMongoDocument|mixed
  * @throws EMongoException
  */
 public function current()
 {
     if ($this->model === null) {
         return $this->current = $this->cursor->current();
     } else {
         return $this->current = $this->model->populateRecord($this->cursor->current(), true, $this->partial);
     }
 }
开发者ID:sammaye,项目名称:mongoyii-php7,代码行数:13,代码来源:Cursor.php

示例6: current

 /**
  * Returns the current file
  *
  * @return MongoGridFSFile - The current file.
  */
 public function current()
 {
     $current = parent::current();
     if (!$current) {
         return null;
     }
     return new MongoGridFSFile($this->gridfs, $current);
 }
开发者ID:Wynncraft,项目名称:mongofill,代码行数:13,代码来源:MongoGridFSCursor.php

示例7: current

 /**
  * {@inheritdoc}
  *
  * @return array|Document
  * @throws ODMException
  * @throws DefinitionException
  */
 public function current()
 {
     $fields = $this->cursor->current();
     if (empty($this->class)) {
         return $fields;
     }
     return $fields ? $this->odm->document($this->class, $fields) : null;
 }
开发者ID:tuneyourserver,项目名称:components,代码行数:15,代码来源:DocumentCursor.php

示例8: current

 /**
  * Iterator::current
  * return current specific object
  *
  * @return MongoObject
  * @throws Exception
  */
 public function current()
 {
     $documentData = $this->myResultCursor->current();
     /** @var MongoObject $document */
     $document = $this->container->getInstanceOf($this->classMapInterface->getClassForResult($this->collection, $documentData));
     $document->setCollection($this->collection);
     $document->loadFromArray($documentData);
     return $document;
 }
开发者ID:ppetermann,项目名称:king23,代码行数:16,代码来源:Result.php

示例9: current

 /**
  * Iterator interface current. Return a model object
  * with cursor document. (used in foreach)
  *
  * @return mixed
  */
 public function current()
 {
     $model = clone $this->model;
     $document = $this->cursor->current();
     if ($model->parseDocument($document)) {
         return $model;
     }
     return false;
 }
开发者ID:irto,项目名称:neomongo,代码行数:15,代码来源:OdmCursor.php

示例10: current

 /**
  * Wrapper method for MongoCursor::current().
  *
  * @see http://php.net/manual/en/iterator.current.php
  * @see http://php.net/manual/en/mongocursor.current.php
  * @return array|null
  */
 public function current()
 {
     $current = $this->mongoCursor->current();
     if ($current instanceof \MongoGridFSFile) {
         $document = $current->file;
         $document['file'] = new GridFSFile($current);
         $current = $document;
     }
     return $current;
 }
开发者ID:ne0h12,项目名称:mongodb,代码行数:17,代码来源:Cursor.php

示例11: 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

示例12: row

 /**
  * Returns the document at the specified index as an object
  *
  * @since v1.0.0
  */
 public function row($index = 0, $class = NULL, $as_object = FALSE)
 {
     $size = $this->_cursor->count();
     $this->_cursor->reset();
     $res = array();
     for ($i = 0; $i < $size; $i++) {
         $this->_cursor->next();
         if ($i == $index && $index <= $size) {
             $res = $as_object ? (object) $this->_cursor->current() : $this->_cursor->current();
             break;
         }
     }
     return $res;
 }
开发者ID:AnthemiusGuo,项目名称:managerproject,代码行数:19,代码来源:Cimongo_cursor.php

示例13: current

 /**
  * Returns the current element
  *
  * @since   0.3.0
  *
  * See [\Iterator::current]
  *
  * @link    http://www.php.net/manual/en/mongocursor.current.php \MongoCursor::current
  *
  * @return  array
  */
 public function current()
 {
     $data = $this->cursor->current();
     if (isset($this->benchmark)) {
         // Stop the benchmark
         Profiler::stop($this->benchmark);
         // Clean benchmark token
         $this->benchmark = null;
     }
     if (!$this->model) {
         return $data;
     }
     $model = clone $this->model;
     return $model->loadValues($data ?: array(), true);
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:26,代码来源:Collection.php

示例14: current

 /**
  * @return Model
  */
 public function current()
 {
     return $this->load_model(parent::current());
 }
开发者ID:doorframework,项目名称:core,代码行数:7,代码来源:Cursor.php

示例15: current

 /**
  * (PHP 5 &gt;= 5.0.0)<br/>
  * Return the current element
  * @link http://php.net/manual/en/iterator.current.php
  * @return mixed Can return any type.
  */
 public function current()
 {
     return $this->cursor->current();
 }
开发者ID:Nkelliny,项目名称:Framework,代码行数:10,代码来源:MongoCursor.php


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