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


PHP MongoCursor::info方法代码示例

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


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

示例1: isIterating

 /**
  * Is the query iterating yet?
  *
  * @link    http://www.php.net/manual/en/mongocursor.info.php \MongoCursor::info
  *
  * @since   0.3.0
  * @since   1.0.0 is_iterating → isIterating
  *
  * @return  boolean
  */
 public function isIterating()
 {
     if (!$this->cursor) {
         return false;
     }
     $info = $this->cursor->info();
     return $info['started_iterating'];
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:18,代码来源:Collection.php

示例2: key

 /**
  * Wrapper method for MongoCursor::key().
  *
  * @see http://php.net/manual/en/iterator.key.php
  * @see http://php.net/manual/en/mongocursor.key.php
  * @return mixed
  */
 public function key()
 {
     // TODO: Track position internally to avoid repeated info() calls
     if (!$this->useIdentifierKeys) {
         $info = $this->mongoCursor->info();
         return isset($info['at']) ? $info['at'] : null;
     }
     return $this->mongoCursor->key();
 }
开发者ID:ne0h12,项目名称:mongodb,代码行数:16,代码来源:Cursor.php

示例3: is_iterating

 /**
  * Is the query iterating yet?
  *
  * @throws Exception
  * @return bool
  */
 public function is_iterating()
 {
     if (!$this->_cursor) {
         return FALSE;
     }
     $info = $this->_cursor->info();
     if (!isset($info['started_iterating'])) {
         throw new Exception('Driver version >= 1.0.10 required.');
     }
     return $info['started_iterating'];
 }
开发者ID:andygoo,项目名称:mongodb-php-odm,代码行数:17,代码来源:collection.php

示例4: fetchRows

 /**
  * Fetches rows from the given Mongo cursor.
  * @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 the column name or PHP callback,
  * by which the query results should be indexed by.
  * @throws Exception on failure.
  * @return array|boolean result.
  */
 protected function fetchRows($cursor, $all = true, $indexBy = null)
 {
     $token = 'find(' . Json::encode($cursor->info()) . ')';
     Yii::info($token, __METHOD__);
     try {
         Yii::beginProfile($token, __METHOD__);
         $result = $this->fetchRowsInternal($cursor, $all, $indexBy);
         Yii::endProfile($token, __METHOD__);
         return $result;
     } catch (\Exception $e) {
         Yii::endProfile($token, __METHOD__);
         throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
     }
 }
开发者ID:aayaresko,项目名称:yii2-extended-mongodb,代码行数:23,代码来源:Query.php

示例5: fetchRows

 /**
  * Fetches rows from the given Mongo cursor.
  *
  * @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 the column name or PHP callback,
  * by which the query results should be indexed by.
  * @throws MongoException on failure.
  * @return array|null result.
  */
 protected function fetchRows($cursor, $all = true, $indexBy = null)
 {
     $rawQuery = 'find(' . Json::encode($cursor->info()) . ')';
     //Log::info($token, __METHOD__);
     $token = ['query' => $rawQuery, 'valid' => true, 'cache' => false];
     Trace::beginProfile('mongodb.query', $token);
     $cache = $cacheKey = null;
     $lock = true;
     if (($result = $this->getCache($rawQuery, $token, $all, $indexBy, $cache, $cacheKey, $lock)) !== false) {
         return $result;
     }
     if ($lock === false) {
         return null;
     }
     try {
         $result = $this->fetchRowsInternal($cursor, $all);
         $this->setCache($result, $cache, $cacheKey);
         Trace::endProfile('mongodb.query', $token);
         Trace::trace('mongodb.query', $token);
         return $result;
     } catch (\Exception $e) {
         $message = $e->getMessage() . "\nThe query being executed was: {$rawQuery}";
         Trace::endProfile('mongodb.query', $token);
         $token['valid'] = false;
         $token['exception'] = defined('ROCK_DEBUG') && ROCK_DEBUG === true ? $e : $message;
         Trace::trace('mongodb.query', $token);
         if (isset($cache, $cacheKey) && $cache instanceof CacheInterface) {
             $cache->unlock($cacheKey);
         }
         throw new MongoException($message, [], 0, $e);
     }
 }
开发者ID:romeoz,项目名称:rock-mongodb,代码行数:42,代码来源:Query.php

示例6: info

 /**
  * Wrapper method for MongoCursor::info().
  *
  * @see http://php.net/manual/en/mongocursor.info.php
  * @return array
  */
 public function info()
 {
     return $this->mongoCursor->info();
 }
开发者ID:shuffleld,项目名称:mongodb,代码行数:10,代码来源:Cursor.php

示例7: info

 /**
  * Gets the query, fields, limit, and skip for this cursor
  * @link http://www.php.net/manual/en/mongocursor.info.php
  * @return array The query, fields, limit, and skip for this cursor as an associative array.
  */
 public function info()
 {
     return $this->cursor->info();
 }
开发者ID:Nkelliny,项目名称:Framework,代码行数:9,代码来源:MongoCursor.php

示例8: info

 /**
  *
  * @return array
  */
 public function info()
 {
     $info = $this->cursor->info();
     return $info;
 }
开发者ID:mpcmf,项目名称:mpcmf-core,代码行数:9,代码来源:modelCursor.php


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