blockManager = $blockManager; } public function getCurrentPage() { return $this->current_page; } public function changeCurrentPage() { if (!$this->current_node) { throw new NodeNotFoundException('Check the decorator_strategy configuration otherwise create a new node to support this path.'); } $page = $this->current_node->getPage(); if ($this->current_node->isHybrid() && !$page) { return; } if (!$page) { throw new PageNotFoundException(sprintf('You must create a page for the node named : "%s"',$this->current_node->getTitle())); } $this->setCurrentPage($page); $this->loadBlocks(); } public function setNavigation(NavigationInterface $nav) { $this->navigation = $nav; } public function setCurrentPage(SeoPageInterface $page) { $this->current_page = $page; } public function setCurrentNode(Node $node) { $this->current_node = $node; } public function getPage() { return $this->current_page; } /** * @return null | Node */ public function getCurrentNode() { return $this->current_node; } public function getMenu($menu_name) { if (null === $this->menus) { $this->loadMenus(); } return $this->menus[$menu_name]; } public function loadBlocks() { $this->blockManager->loadPageBlocks($this->current_page); } public function loadMenus() { $menus = $this->navigation->getMenus(); foreach ($menus as $menu) { $menu->loadVisibleNodes(); $this->menus[$menu->getName()] = $menu; } } }