public function searchEvents(
        Production $production,
        \DateTime $from,
        \DateTime $to,
        bool $active = true
    ) {
        $qb = $this->createQueryBuilder('e');

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

            // Add conditions.
            ->andWhere($qb->expr()->eq('g', ':group'))
            ->andWhere($qb->expr()->between('e.start', ':from', ':to'))
            ->andWhere($qb->expr()->eq('e.active', ':active'))

            // Add parameters.
            ->setParameter('group', $production)
            ->setParameter('from', $from)
            ->setParameter('to', $to)
            ->setParameter('active', $active)

            // Get results.
            ->getQuery()
            ->getResult();
    }