public function findOneByName($name)
    {
        $qb = $this->getQueryBuilder();

        return $qb
            ->leftJoin('c.containers', 'container')
            ->leftJoin('container.rows', 'row')
            ->leftJoin('row.blocks', 'block')
            ->leftJoin('block.translations', 'block_t')
            ->addSelect('container', 'row', 'block', 'block_t')
            ->andWhere($qb->expr()->eq('c.name', ':name'))
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Content::getEntityTagPrefix() . '[name:'.$name.']')
            ->setParameter('name', $name)
            ->getOneOrNullResult();
    }
public function findOneByName($name)
    {
        $qb = $this->getQueryBuilder();

        return $qb
            ->leftJoin('c.containers', 'container')
            ->leftJoin('container.rows', 'row')
            ->leftJoin('row.blocks', 'block')
            ->leftJoin('block.translations', 'block_t')
            ->addSelect('container', 'row', 'block', 'block_t')
            ->andWhere($qb->expr()->eq('c.name', ':name'))
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Content::getEntityTagPrefix() . '[name:'.$name.']')
            ->setParameter('name', $name)
            ->getOneOrNullResult();
    }
public function findOneByName ( $ name ) { $ qb = $ this -> getQueryBuilder ( ) ; return $ qb -> leftJoin ( 'c.containers' , 'container' ) -> leftJoin ( 'container.rows' , 'row' ) -> leftJoin ( 'row.blocks' , 'block' ) -> leftJoin ( 'block.translations' , 'block_t' ) -> addSelect ( 'container' , 'row' , 'block' , 'block_t' ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'c.name' , ':name' ) ) -> getQuery ( ) -> useQueryCache ( true ) // TODO ->useResultCache(true, 3600, Content::getEntityTagPrefix() . '[name:'.$name.']') -> setParameter ( 'name' , $ name ) -> getOneOrNullResult ( ) ; }
Finds the content by id.

@param int $name

@return \Ekyna\Bundle\CmsBundle\Editor\Model\ContentInterface|null
Finds the content by id .