private function getMenuItems($rootLocationId)
    {
        $rootLocation = $this->locationService->loadLocation($rootLocationId);

        $query = new LocationQuery();

        $query->query = new Criterion\LogicalAnd(
            array(
                new Criterion\ContentTypeIdentifier($this->getTopMenuContentTypeIdentifierList()),
                new Criterion\Visibility(Criterion\Visibility::VISIBLE),
                new Criterion\Location\Depth(
                    Criterion\Operator::BETWEEN,
                    array($rootLocation->depth + 1, $rootLocation->depth + 2)
                ),
                new Criterion\Subtree($rootLocation->pathString),
                new Criterion\LanguageCode($this->configResolver->getParameter('languages')),
            )
        );
        $query->sortClauses = array(new Query\SortClause\Location\Path());
        $query->performCount = false;

        return $this->searchService->findLocations($query)->searchHits;
    }
private function getMenuItems($rootLocationId)
    {
        $rootLocation = $this->locationService->loadLocation($rootLocationId);

        $query = new LocationQuery();

        $query->query = new Criterion\LogicalAnd(
            array(
                new Criterion\ContentTypeIdentifier($this->getTopMenuContentTypeIdentifierList()),
                new Criterion\Visibility(Criterion\Visibility::VISIBLE),
                new Criterion\Location\Depth(
                    Criterion\Operator::BETWEEN,
                    array($rootLocation->depth + 1, $rootLocation->depth + 2)
                ),
                new Criterion\Subtree($rootLocation->pathString),
                new Criterion\LanguageCode($this->configResolver->getParameter('languages')),
            )
        );
        $query->sortClauses = array(new Query\SortClause\Location\Path());
        $query->performCount = false;

        return $this->searchService->findLocations($query)->searchHits;
    }
private function getMenuItems ( $ rootLocationId ) { $ rootLocation = $ this -> locationService -> loadLocation ( $ rootLocationId ) ; $ query = new LocationQuery ( ) ; $ query -> query = new Criterion \ LogicalAnd ( array ( new Criterion \ ContentTypeIdentifier ( $ this -> getTopMenuContentTypeIdentifierList ( ) ) , new Criterion \ Visibility ( Criterion \ Visibility :: VISIBLE ) , new Criterion \ Location \ Depth ( Criterion \ Operator :: BETWEEN , array ( $ rootLocation -> depth + 1 , $ rootLocation -> depth + 2 ) ) , new Criterion \ Subtree ( $ rootLocation -> pathString ) , new Criterion \ LanguageCode ( $ this -> configResolver -> getParameter ( 'languages' ) ) , ) ) ; $ query -> sortClauses = array ( new Query \ SortClause \ Location \ Path ( ) ) ; $ query -> performCount = false ; return $ this -> searchService -> findLocations ( $ query ) -> searchHits ; }
Queries the repository for menu items, as locations filtered on the list in TopIdentifierList in menu.ini.
@param int|string $rootLocationId Root location for menu items. Only two levels below this one are searched
@return SearchHit[]
Queries the repository for menu items as locations filtered on the list in TopIdentifierList in menu . ini .