Ejemplo n.º 1
0
 /**
  * Subdocument constructor
  *
  * This class needs to know which database to work with, so 
  * it has a self::getDatabase() function which calls 
  * ZFE_Model_Mongo::getDatabase(). And this initializes the
  * Mongo resource.
  */
 public function __construct()
 {
     parent::__construct();
     $this->_refCache = array();
     self::getDatabase();
     // Sets an ID for the subdocument so we have something to
     // refer to it with.
     $this->_data['id'] = new MongoId();
 }
Ejemplo n.º 2
0
 /**
  * Mongo constructor, that calls the getDatabase() function, which in
  * turn initializes the Mongo application plugin resource.
  */
 public function __construct()
 {
     parent::__construct();
     $this->_refCache = array();
     static::getDatabase();
 }