/** * @param Entity_Tree $tree * @param Entity_Block $block * @return bool */ public function updateBlock($tree, $block) { $old = new Entity_Tree(); $old->init($this->treeDAO->getOne($tree->getId())); $link = rtrim($old->getLink(), $old->getName()) . $tree->getName(); $tree->setLink($link); $block->setId($old->getTypeId()); return $this->blockDAO->update($block) && $this->treeDAO->updateTree($tree); }
/** * @param Entity_Tree $tree * @param Entity_Page $page * @return bool */ public function updatePage($tree, $page) { $old = new Entity_Tree(); $old->init($this->treeDAO->getOne($tree->getId())); $link = rtrim($old->getLink(), $old->getName()) . $tree->getName(); $tree->setLink($link); $page->setId($old->getTypeId()); return $this->pageDAO->update($page) && $this->treeDAO->updateTree($tree); }