public function flat($filter = 'default') { $result = []; foreach ($this->all($filter) as $node) { foreach (Helper::flatify($node) as $flatted) { $result[] = $flatted; } } return $result; }
protected function getPageList($page) { $list = array(); $this->addFirstPageListEntry($list); $treeModel = $this->createTreeModel($page); foreach (Helper::flatify($treeModel->tree()) as $page) { $list[$page->getIdentifier()] = $page->menu_title; } return $list; }
/** * @brief Retrieve a tree by its rootId * * @param mixed $rootId The id of its root node, which is the same as node->getRootId() * @return NodeInterface **/ public function tree($rootId = NULL) { if ($rootId === NULL) { $rootId = '__root'; } if (!isset($this->_rootNodeCache[$rootId])) { $result = $this->getHierarchyByRootIdQuery($rootId)->get($this->getSelectColumns()); $this->fillNodeCache($result); Helper::toHierarchy($result); } return $this->_rootNodeCache[$rootId]; }