/**
  * Filter action
  *
  * @param array $overwriteDemand
  */
 public function filterAction($overwriteDemand = NULL)
 {
     $genreUids = GeneralUtility::intExplode(',', $this->settings['genres'], TRUE);
     $eventLocationUids = GeneralUtility::intExplode(',', $this->settings['eventLocations'], TRUE);
     $eventTypeUids = GeneralUtility::intExplode(',', $this->settings['eventTypes'], TRUE);
     $audienceUids = GeneralUtility::intExplode(',', $this->settings['audiences'], TRUE);
     if (count($genreUids)) {
         $genres = [];
         foreach ($genreUids as $genreUid) {
             if ($this->courseRepository->countContainingGenre($genreUid)) {
                 $genres[] = $this->genreRepository->findByUid($genreUid);
             }
         }
     } else {
         $genres = $this->genreRepository->findAll();
     }
     if (count($eventLocationUids)) {
         $eventLocations = [];
         foreach ($eventLocationUids as $eventLocationUid) {
             if ($this->lessonRepository->countByEventLocation($eventLocationUid)) {
                 $eventLocations[] = $this->eventLocationRepository->findByUid($eventLocationUid);
             }
         }
     } else {
         $eventLocations = $this->eventLocationRepository->findAll();
     }
     if (count($eventTypeUids)) {
         $eventTypes = [];
         foreach ($eventTypeUids as $eventTypeUid) {
             if ($this->courseRepository->countByEventType($eventTypeUid)) {
                 $eventTypes[] = $this->eventTypeRepository->findByUid($eventTypeUid);
             }
         }
     } else {
         $eventTypes = $this->eventTypeRepository->findAll();
     }
     if (count($audienceUids)) {
         $audiences = [];
         foreach ($audienceUids as $audienceUid) {
             if ($this->courseRepository->countContainingAudience($audienceUid)) {
                 $audiences[] = $this->audienceRepository->findByUid($audienceUid);
             }
         }
     } else {
         $audiences = $this->audienceRepository->findAll();
     }
     $this->view->assignMultiple(['overwriteDemand' => $overwriteDemand, 'genres' => $genres, 'eventLocations' => $eventLocations, 'audiences' => $audiences, 'eventTypes' => $eventTypes]);
 }
 /**
  * Gets all expired lessons
  *
  * @param string $date A string that the strtotime(), DateTime and date_create() parser understands. Default: 'now'
  * @return \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
  */
 protected function getLessonsWithExpiredDeadline($date = NULL)
 {
     /** @var ScheduleDemand $lessonDemand */
     $lessonDemand = $this->createDemandForLessonsWithExpiredDeadline($date);
     return $this->lessonRepository->findDemanded($lessonDemand);
 }