Create a new cursor
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; }
/** * 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); }
/** * 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); }
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); }
/** * 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); }
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); }
public function __construct() { parent::__construct(); }
public function __construct($mongo, $ns, $query, $fields, $collection) { $this->_collection = $collection; parent::__construct($mongo, $ns, $query, $fields); }