Source of file PresentationHolder.php
Size: 0,796 Bytes - Last Modified: 2021-12-23T10:11:56+00:00
/var/www/docs.ssmods.com/process/src/code/Model/PresentationHolder.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php class PresentationHolder extends Page { public function getBlocks() { $pages = array(); foreach ($this->getBlockPages() as $page) { array_push($pages, $page->ID); } return Section::get()->filterAny('PageID', $pages); } public function BlockHolders() { return $this->getAllPages()->filter('ClassName', 'BlockHolder'); } public function getBlockPages() { return $this->getAllPages()->filter('ClassName', 'BlockPage'); } public function getAllPages() { $list = arrayList::create(); return $this->getPages(0, $list); } public function getPages($ID, $list) { $pages = SiteTree::get()->filter('ParentID', $ID)->sort('Sort', 'ASC'); foreach ($pages as $page) { $list->push($page); $list = $this->getPages($page->ID, $list); } return $list; } } |