public function findArchivedEventsQuery(Production $production)
    {
        $qb = $this->createQueryBuilder('e');

        return $qb
            // Add joins.
            ->join('e.groups', 'g')

            // Add conditions.
            ->andWhere($qb->expr()->eq('g', ':production'))
            ->andWhere($qb->expr()->eq('e.active', ':active'))
            ->andWhere($qb->expr()->isNull('e.schedule'))

            // Add parameters.
            ->setParameter('production', $production)
            ->setParameter('active', false)

            // Add ordering.
            ->addOrderBy('e.updated', 'DESC')

            // Get query.
            ->getQuery();
    }
public function findArchivedEventsQuery(Production $production)
    {
        $qb = $this->createQueryBuilder('e');

        return $qb
            // Add joins.
            ->join('e.groups', 'g')

            // Add conditions.
            ->andWhere($qb->expr()->eq('g', ':production'))
            ->andWhere($qb->expr()->eq('e.active', ':active'))
            ->andWhere($qb->expr()->isNull('e.schedule'))

            // Add parameters.
            ->setParameter('production', $production)
            ->setParameter('active', false)

            // Add ordering.
            ->addOrderBy('e.updated', 'DESC')

            // Get query.
            ->getQuery();
    }
public function findArchivedEventsQuery ( Production $ production ) { $ qb = $ this -> createQueryBuilder ( 'e' ) ; return $ qb // Add joins. -> join ( 'e.groups' , 'g' ) // Add conditions. -> andWhere ( $ qb -> expr ( ) -> eq ( 'g' , ':production' ) ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'e.active' , ':active' ) ) -> andWhere ( $ qb -> expr ( ) -> isNull ( 'e.schedule' ) ) // Add parameters. -> setParameter ( 'production' , $ production ) -> setParameter ( 'active' , false ) // Add ordering. -> addOrderBy ( 'e.updated' , 'DESC' ) // Get query. -> getQuery ( ) ; }
Helper function to search for events that are not active.

@param Production $production The production to search in.

@return Event[]
Helper function to search for events that are not active .