Exemplo n.º 1
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();
 }
Exemplo n.º 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->fqn = $db->_getFullCollectionName($name);
     $this->client = $db->_getClient();
     $this->protocol = $this->client->_getProtocol();
 }