Example #1
0
 /**
  * @param null|Cm_Mongo_Model_Resource_Abstract $resource
  */
 public function __construct($resource = NULL)
 {
     parent::__construct();
     $this->_construct();
     $this->_resource = $resource;
     $this->_conn = $this->getResource()->getReadConnection();
     $this->_query = $this->_conn->selectCollection($this->getCollectionName());
 }
Example #2
0
 /**
  * Get the Mongo_Database instance used for this collection
  *
  * @return  Mongo_Database
  */
 public function db()
 {
     return Mongo_Database::instance($this->db);
 }
Example #3
0
 protected function setUp()
 {
     $this->db = Mongo_Database::instance('mongotest', array('database' => 'mongotest'));
     $this->db->createCollection('mongotest');
     $this->db->mongotest->remove(array());
 }
Example #4
0
 public function setup()
 {
     $this->db = Mongo_Database::instance('mongotest', array('database' => 'mongotest', 'profiling' => TRUE));
     $this->db->createCollection('mongotest');
     $this->db->mongotest->remove(array());
 }