public function setPage(a\Page $page = NULL) { // required if ($this->required && $page == NULL) { throw new e\EmptyValueException(S_SPAN . c\M::NULL_PAGE . E_SPAN); } if ($this->asset_type != c\T::PAGE) { throw new e\NodeException(S_SPAN . "The asset does not accept a page." . E_SPAN); } if (isset($page)) { $this->page_id = $page->getId(); $this->page_path = $page->getPath(); } else { $this->page_id = NULL; $this->page_path = NULL; } return $this; }
public function removePage(Page $page) { $id = $page->getId(); $temp = array(); foreach ($this->pages as $page) { if ($page->getId() != $id) { $temp[] = $page; } } $this->pages = $temp; return $this; }