original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: Search for events within a production.
  
  @param Production $production The production to search in.
  @param \DateTime  $from       The time to start searching from.
  @param \DateTime  $to         The time to end searching from.
  @param bool       $active     The active state of the events.
  
  @return Event[]
docstring_tokens: Search for events within a production .