collectionName = $collectionName; // $this->saveableObject = $saveableObject; $this->constrainedObject = new ConstrainedObject($saveableObject); } public function __set($attr,$value){ // $this->saveableObject->$attr = $value; $this->constrainedObject->$attr = $value; } public function __get($attr){ // return $this->saveableObject->$attr; return $this->constrainedObject->$attr; } public function __unset($attr){ // unset($this->saveableObject->$attr); unset($this->constrainedObject->$attr); } /** * (non-PHPdoc) * @see DaoSaveable::getSaveableObj() */ public function getSaveableObj(){ // return $this->saveableObject->get(); return $this->constrainedObject->get(); } /** * (non-PHPdoc) * @see DaoSaveable::getCollectionName() */ public function getCollectionName(){ return $this->collectionName; } /** * (non-PHPdoc) * @see DaoSaveable::buildFromSaveableObj() */ public static function buildFromSaveableObj($collectionName, $saveableObject){ return new static($collectionName, $saveableObject); } /** * (non-PHPdoc) * @see DaoSaveable::updateFromSaveableObj() */ public function updateFromSaveableObj($obj){ // $this->saveableObject = $obj; $this->constrainedObject = new ConstrainedObject($saveableObject); } protected function getConstrainedObject(){ return $this->constrainedObject; } } ?>