/**
  * {@inheritdoc}
  */
 public function getRootNode()
 {
     $tree = $this->treeProvider->getTree(TadckaSitemapBundle::SITEMAP_TREE);
     if (null === $tree) {
         throw new ResourceNotFoundException(sprintf('Tree %s not found', TadckaSitemapBundle::SITEMAP_TREE));
     }
     $rootNode = $this->nodeManager->findRootNode($tree);
     if (null === $rootNode) {
         $rootNode = $this->nodeManager->create();
         $rootNode->setTree($tree);
         $this->nodeManager->add($rootNode);
     }
     return $rootNode;
 }
Example #2
0
 /**
  * Get root node icon.
  *
  * @return null|string
  */
 private function getRootNodeIcon()
 {
     $config = $this->treeProvider->getTreeConfig(TadckaSitemapBundle::SITEMAP_TREE);
     if (null !== $config) {
         return $config->getIconPath();
     }
     return null;
 }
 private function addTree()
 {
     $this->treeProvider->expects($this->any())->method('getTree')->willReturn($this->getMock('Tadcka\\Component\\Tree\\Model\\TreeInterface'));
 }