本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例7: __construct
public function __construct()
{
parent::__construct();
}
示例8: __construct
public function __construct($mongo, $ns, $query, $fields, $collection)
{
$this->_collection = $collection;
parent::__construct($mongo, $ns, $query, $fields);
}