public function getRouteByName($name, $parameters = [])
    {
        $qb = $this->pageRepository->createQueryBuilder('p');
        $results = $qb
            ->select('p.route, p.controller, t.path, t.locale')
            ->join('p.translations', 't')
            ->andWhere($qb->expr()->eq('p.static', 0))
            ->andWhere($qb->expr()->eq('p.route', $qb->expr()->literal($name)))
            ->getQuery()
            ->getArrayResult()
        ;

        $routes = $this->transformResultsToRoutes($results);
        if (count($routes) == 1) {
            return current($routes);
        }

        return null;
    }
public function getRouteByName($name, $parameters = [])
    {
        $qb = $this->pageRepository->createQueryBuilder('p');
        $results = $qb
            ->select('p.route, p.controller, t.path, t.locale')
            ->join('p.translations', 't')
            ->andWhere($qb->expr()->eq('p.static', 0))
            ->andWhere($qb->expr()->eq('p.route', $qb->expr()->literal($name)))
            ->getQuery()
            ->getArrayResult()
        ;

        $routes = $this->transformResultsToRoutes($results);
        if (count($routes) == 1) {
            return current($routes);
        }

        return null;
    }
public function getRouteByName ( $ name , $ parameters = [ ] ) { $ qb = $ this -> pageRepository -> createQueryBuilder ( 'p' ) ; $ results = $ qb -> select ( 'p.route, p.controller, t.path, t.locale' ) -> join ( 'p.translations' , 't' ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'p.static' , 0 ) ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'p.route' , $ qb -> expr ( ) -> literal ( $ name ) ) ) -> getQuery ( ) -> getArrayResult ( ) ; $ routes = $ this -> transformResultsToRoutes ( $ results ) ; if ( count ( $ routes ) == 1 ) { return current ( $ routes ) ; } return null ; }
Finds a Route by name.

@param string $name
@param array $parameters

@return null|Route
Finds a Route by name .