/** * @param string $name * @param mixed $value * @return $this */ public function __set($name, $value) { parent::__set($name, $value); if (!is_null($this->sectionObject)) { $this->getSection()->update(); } return $this; }
/** * @param ItemDecorator $page * @param integer $priority * @return $this */ public function addPage(ItemDecorator &$page, $priority = 1) { $priority = (int) $priority; if (!acl_check($page->getPermissions())) { return $this; } if (isset($page->priority)) { $priority = (int) $page->priority; } if ($page instanceof Section) { $this->sections[] = $page; $page->setSection($this); } else { if (isset($this->pages[$priority])) { while (isset($this->pages[$priority])) { $priority++; } } $this->pages[$priority] = $page; } $page->setSection($this); return $this->update()->sort(); }