public function addEventFilter(FilterCollectionEvent $event): void
    {
        $now = new \DateTime();
        $qb = $event->getQueryBuilder();
        $query = $qb->query()->bool()
            ->addMust($qb->query()->term(['_index' => 'event']))
            ->addMust($qb->query()->term(['active' => true]))
            ->addMust($qb->query()->terms('groups.id', $event->getGroupIds()))
            ->addMustNot($qb->query()->exists('schedule'))
        ;
        $event->addFilter($query);
    }
public function addEventFilter(FilterCollectionEvent $event): void
    {
        $now = new \DateTime();
        $qb = $event->getQueryBuilder();
        $query = $qb->query()->bool()
            ->addMust($qb->query()->term(['_index' => 'event']))
            ->addMust($qb->query()->term(['active' => true]))
            ->addMust($qb->query()->terms('groups.id', $event->getGroupIds()))
            ->addMustNot($qb->query()->exists('schedule'))
        ;
        $event->addFilter($query);
    }
public function addEventFilter ( FilterCollectionEvent $ event ) : void { $ now = new \ DateTime ( ) ; $ qb = $ event -> getQueryBuilder ( ) ; $ query = $ qb -> query ( ) -> bool ( ) -> addMust ( $ qb -> query ( ) -> term ( [ '_index' => 'event' ] ) ) -> addMust ( $ qb -> query ( ) -> term ( [ 'active' => true ] ) ) -> addMust ( $ qb -> query ( ) -> terms ( 'groups.id' , $ event -> getGroupIds ( ) ) ) -> addMustNot ( $ qb -> query ( ) -> exists ( 'schedule' ) ) ; $ event -> addFilter ( $ query ) ; }
Add the event filter to search.

@param FilterCollectionEvent $event The filter collection event.

@return void
Add the event filter to search .