public function findOneByRoute($routeName)
    {
        $qb = $this->getQueryBuilder('p');

        return $qb
            ->leftJoin('p.seo', 's')
            ->leftJoin('s.translations', 's_t', Expr\Join::WITH, $this->getLocaleCondition('s_t'))
            ->addSelect('s', 's_t')
            ->andWhere($qb->expr()->eq('p.route', ':route_name'))
            ->getQuery()
            ->setParameter('route_name', $routeName)
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, 'ekyna_cms.page[route:' . $routeName . ']')
            ->getOneOrNullResult();
    }
public function findOneByRoute($routeName)
    {
        $qb = $this->getQueryBuilder('p');

        return $qb
            ->leftJoin('p.seo', 's')
            ->leftJoin('s.translations', 's_t', Expr\Join::WITH, $this->getLocaleCondition('s_t'))
            ->addSelect('s', 's_t')
            ->andWhere($qb->expr()->eq('p.route', ':route_name'))
            ->getQuery()
            ->setParameter('route_name', $routeName)
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, 'ekyna_cms.page[route:' . $routeName . ']')
            ->getOneOrNullResult();
    }
public function findOneByRoute ( $ routeName ) { $ qb = $ this -> getQueryBuilder ( 'p' ) ; return $ qb -> leftJoin ( 'p.seo' , 's' ) -> leftJoin ( 's.translations' , 's_t' , Expr \ Join :: WITH , $ this -> getLocaleCondition ( 's_t' ) ) -> addSelect ( 's' , 's_t' ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'p.route' , ':route_name' ) ) -> getQuery ( ) -> setParameter ( 'route_name' , $ routeName ) -> useQueryCache ( true ) // TODO ->useResultCache(true, 3600, 'ekyna_cms.page[route:' . $routeName . ']') -> getOneOrNullResult ( ) ; }
Finds a page by request.

@param string $routeName

@return null|PageInterface
Finds a page by request .