Sulu\Bundle\WebsiteBundle\Navigation\NavigationMapperInterface::getRootNavigation PHP Méthode

getRootNavigation() public méthode

returns navigation from root.
public getRootNavigation ( string $webspaceKey, string $locale, integer $depth = 1, boolean $flat = false, string | null $context = null, boolean $loadExcerpt = false ) : NavigationItem[]
$webspaceKey string
$locale string
$depth integer
$flat boolean
$context string | null
$loadExcerpt boolean
Résultat NavigationItem[]
    public function getRootNavigation($webspaceKey, $locale, $depth = 1, $flat = false, $context = null, $loadExcerpt = false);

Usage Example

Exemple #1
0
 public function testNavigationStateTestParent()
 {
     $this->data['products'] = $this->mapper->save(['title' => 'Products', 'url' => '/products'], 'simple', 'sulu_io', 'en', 1, true, $this->data['products']->getUuid(), null, StructureInterface::STATE_TEST);
     $navigation = $this->navigation->getRootNavigation('sulu_io', 'en', 2);
     $this->assertCount(1, $navigation);
     $this->assertEquals('/news', $navigation[0]['url']);
     $this->assertCount(2, $navigation[0]['children']);
     $this->assertEquals('/news/news-1', $navigation[0]['children'][0]['url']);
     $this->assertEquals('/news/news-2', $navigation[0]['children'][1]['url']);
 }
All Usage Examples Of Sulu\Bundle\WebsiteBundle\Navigation\NavigationMapperInterface::getRootNavigation