コード例 #1
0
 /**
  * {@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;
 }
コード例 #2
0
ファイル: TreeHelper.php プロジェクト: aistis-/SitemapBundle
 /**
  * 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;
 }
コード例 #3
0
 private function addTree()
 {
     $this->treeProvider->expects($this->any())->method('getTree')->willReturn($this->getMock('Tadcka\\Component\\Tree\\Model\\TreeInterface'));
 }