/** * @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()); }
/** * Get the Mongo_Database instance used for this collection * * @return Mongo_Database */ public function db() { return Mongo_Database::instance($this->db); }
protected function setUp() { $this->db = Mongo_Database::instance('mongotest', array('database' => 'mongotest')); $this->db->createCollection('mongotest'); $this->db->mongotest->remove(array()); }
public function setup() { $this->db = Mongo_Database::instance('mongotest', array('database' => 'mongotest', 'profiling' => TRUE)); $this->db->createCollection('mongotest'); $this->db->mongotest->remove(array()); }