public function findAllPublishedIndexableOrdered()
    {
        $builder = $this->createQueryBuilder('a')->orderBy('a.startedAt', 'DESC');
        $builder->where(
            $builder->expr()->andX(
                $builder->expr()->isNotNull('a.startedAt'),
                $builder->expr()->lte('a.startedAt', ':now'),
                $builder->expr()->orX(
                    $builder->expr()->isNull('a.endedAt'),
                    $builder->expr()->gte('a.endedAt', ':now')
                )
            )
        )->innerJoin('a.metas', 'm', Join::WITH, 'm.contents = :value');

        return $builder->setParameters(array(
                'now'   => new \DateTime(),
                'value' => 'index,follow',
            )
        )->getQuery()->getResult();
    }
public function findAllPublishedIndexableOrdered()
    {
        $builder = $this->createQueryBuilder('a')->orderBy('a.startedAt', 'DESC');
        $builder->where(
            $builder->expr()->andX(
                $builder->expr()->isNotNull('a.startedAt'),
                $builder->expr()->lte('a.startedAt', ':now'),
                $builder->expr()->orX(
                    $builder->expr()->isNull('a.endedAt'),
                    $builder->expr()->gte('a.endedAt', ':now')
                )
            )
        )->innerJoin('a.metas', 'm', Join::WITH, 'm.contents = :value');

        return $builder->setParameters(array(
                'now'   => new \DateTime(),
                'value' => 'index,follow',
            )
        )->getQuery()->getResult();
    }
public function findAllPublishedIndexableOrdered ( ) { $ builder = $ this -> createQueryBuilder ( 'a' ) -> orderBy ( 'a.startedAt' , 'DESC' ) ; $ builder -> where ( $ builder -> expr ( ) -> andX ( $ builder -> expr ( ) -> isNotNull ( 'a.startedAt' ) , $ builder -> expr ( ) -> lte ( 'a.startedAt' , ':now' ) , $ builder -> expr ( ) -> orX ( $ builder -> expr ( ) -> isNull ( 'a.endedAt' ) , $ builder -> expr ( ) -> gte ( 'a.endedAt' , ':now' ) ) ) ) -> innerJoin ( 'a.metas' , 'm' , Join :: WITH , 'm.contents = :value' ) ; return $ builder -> setParameters ( array ( 'now' => new \ DateTime ( ) , 'value' => 'index,follow' , ) ) -> getQuery ( ) -> getResult ( ) ; }
Get all published Articles ordered by start publication date DESC
And with index,follow meta

@author Vincent Chalamon <vincentchalamon@gmail.com>

@return array
Get all published Articles ordered by start publication date DESC And with index follow meta