コード例 #1
0
ファイル: MongoCollection.php プロジェクト: taniele/mongofill
 /**
  * Creates a new collection
  *
  * @param MongoDB $db   - Parent database.
  * @param string  $name -
  *
  * @return - Returns a new collection object.
  */
 public function __construct(MongoDB $db, $name)
 {
     $this->db = $db;
     $this->name = $name;
     $this->fqn = $db->_getFullCollectionName($name);
     $this->client = $db->_getClient();
     $this->protocol = $this->client->_getProtocol();
 }
コード例 #2
0
 /**
  * Creates a new collection
  *
  * @param MongoDB $db   - Parent database.
  * @param string  $name -
  *
  * @return - Returns a new collection object.
  */
 public function __construct(MongoDB $db, $name)
 {
     $this->db = $db;
     $this->name = $name;
     $this->readPreference = $db->getReadPreference();
     $this->fqn = $db->_getFullCollectionName($name);
     $this->client = $db->_getClient();
 }
コード例 #3
0
ファイル: MongoGridFS.php プロジェクト: taniele/mongofill
 /**
  * Queries for files
  *
  * @param array $query - The query.
  * @param array $fields - Fields to return.
  * @return MongoGridFSCursor - A MongoGridFSCursor.
  */
 public function find(array $query = [], array $fields = [])
 {
     return new MongoGridFSCursor($this, $this->db->_getClient(), $this->__toString(), $query, $fields);
 }