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