當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MongoCursor::__construct方法代碼示例

本文整理匯總了PHP中MongoCursor::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP MongoCursor::__construct方法的具體用法?PHP MongoCursor::__construct怎麽用?PHP MongoCursor::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MongoCursor的用法示例。


在下文中一共展示了MongoCursor::__construct方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($collection, $className = 'Phalcon\\Db\\Adapter\\Mongo\\Cursor', $query = array(), $fields = array())
 {
     $ns = $collection->db->name . '.' . $collection->getName();
     parent::__construct($collection->db->conn, $ns, $query, $fields);
     $this->collection = $collection;
     $this->className = $className;
 }
開發者ID:lisong,項目名稱:incubator,代碼行數:7,代碼來源:Cursor.php

示例2: __construct

 /**
  * Class constructor
  * 
  * @param \MongoClient      $connection
  * @param Collection|string $ns
  * @param array             $query
  * @param array             $fields
  */
 public function __construct(\MongoClient $connection, $ns, array $query = [], array $fields = [])
 {
     if ($ns instanceof Collection) {
         $this->collection = $ns;
     }
     $this->lazy = !empty($fields);
     parent::__construct($connection, (string) $ns, $query, $fields);
 }
開發者ID:jasny,項目名稱:db-mongo,代碼行數:16,代碼來源:Cursor.php

示例3: __construct

 /**
  * Constructor.
  */
 public function __construct(LoggableMongoCollection $collection, array $query = array(), array $fields = array(), $type = 'find')
 {
     $this->collection = $collection;
     $mongo = $collection->getDB()->getMongo();
     $ns = $collection->getDB()->__toString() . '.' . $collection->getName();
     $this->type = $type;
     $this->explainCursor = new \MongoCursor($mongo, $ns, $query, $fields);
     $this->time = new Time();
     parent::__construct($mongo, $ns, $query, $fields);
 }
開發者ID:hybr,項目名稱:jpm,代碼行數:13,代碼來源:LoggableMongoCursor.php

示例4: __construct

 public function __construct($objectType, $filter = array(), $collectionName = null)
 {
     $this->objectType = $objectType;
     $objectType;
     if ($collectionName === null) {
         $collectionName = $objectType::collectionName;
     } else {
         $this->collectionName = $collectionName;
     }
     $databases = Conf::f('databases', array());
     $config = Conf::f('storage-mongodb-object', array());
     $dbName = isset($config['databases']) ? $config['databases'] : 'default';
     if (!isset($databases[$dbName])) {
         throw new \photon\db\UndefinedConnection(sprintf('The connection "%s" is not defined in the configuration.', $db));
     }
     $class = class_exists('\\MongoClient') ? '\\MongoClient' : '\\Mongo';
     $conn = new $class($databases[$dbName]['server'], $databases[$dbName]['options']);
     $ns = $databases[$dbName]['database'] . '.' . $collectionName;
     $fields = array('_id' => 1);
     parent::__construct($conn, $ns, $filter, $fields);
 }
開發者ID:photon,項目名稱:storage-mongodb-object,代碼行數:21,代碼來源:ObjectIterator.php

示例5: __construct

 /**
  * Create a new cursor
  *
  * @link http://php.net/manual/en/mongogridfscursor.construct.php
  * @param MongoGridFS $gridfs Related GridFS collection
  * @param MongoClient $connection Database connection
  * @param string $ns Full name of database and collection
  * @param array $query Database query
  * @param array $fields Fields to return
  * @return MongoGridFSCursor Returns the new cursor
  */
 public function __construct(MongoGridFS $gridfs, MongoClient $connection, $ns, array $query = array(), array $fields = array())
 {
     $this->gridfs = $gridfs;
     parent::__construct($connection, $ns, $query, $fields);
 }
開發者ID:lewnie,項目名稱:mongo-php-adapter,代碼行數:16,代碼來源:MongoGridFSCursor.php

示例6: __construct

 public function __construct(Model $model, \MongoClient $connection, $ns, array $query = array(), array $fields = array())
 {
     $this->model_name = $model->get_model_name();
     $this->model = $model;
     parent::__construct($connection, $ns, $query, $fields);
 }
開發者ID:doorframework,項目名稱:core,代碼行數:6,代碼來源:Cursor.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
 }
開發者ID:igor822,項目名稱:nosqlibr,代碼行數:4,代碼來源:Cursor.php

示例8: __construct

 public function __construct($mongo, $ns, $query, $fields, $collection)
 {
     $this->_collection = $collection;
     parent::__construct($mongo, $ns, $query, $fields);
 }
開發者ID:rudiedirkx,項目名稱:MongoPlus,代碼行數:5,代碼來源:MongoPlus.php


注:本文中的MongoCursor::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。