/** * 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(); }
/** * 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(); }