/**
  * action list
  *
  * @param array $overwriteDemand
  * @return void
  */
 public function listAction($overwriteDemand = NULL)
 {
     $demand = $this->createDemandFromSettings($this->settings);
     if ($overwriteDemand) {
         $this->overwriteDemandObject($demand, $overwriteDemand);
     }
     $lessons = $this->lessonRepository->findDemanded($demand, FALSE);
     if ($lessons instanceof QueryResult and !$lessons->count() or !count($lessons)) {
         $this->addFlashMessage(LocalizationUtility::translate('message.noLessonsForSelection.text', $this->extensionName), LocalizationUtility::translate('message.noLessonsForSelection.title', $this->extensionName), FlashMessage::NOTICE);
     }
     $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $this->view->assignMultiple(['lessons' => $lessons, 'demand' => $demand, 'overwriteDemand' => $overwriteDemand, 'storagePid' => $configuration['persistence']['storagePid']]);
 }
 /**
  * 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);
 }