/** * Add one object into objects and its associated db to watch * @param epObject $o * @param epDbObject $db * @return bool */ public function addObject($o, $db) { // validate input if (!$o instanceof epObject) { return false; } // has object been kept? $uid = $o->epGetUId(); if (!isset($this->objects[$uid])) { // check if object is in transaction. start if not if (!$o->epInTransaction()) { $o->epStartTransaction(); } // add the associated db to watch $this->addDb($db); // add if not $this->objects[$uid] = $o; } return true; }