/** * action list * * @param array $overwriteDemand * @return void */ public function listAction($overwriteDemand = NULL) { $demand = $this->createDemandFromSettings($overwriteDemand); $courses = $this->courseRepository->findDemanded($demand); if ($courses instanceof QueryResult and !$courses->count() or !count($courses)) { $this->addFlashMessage($this->translate('message.noCoursesFound.text'), $this->translate('message.noCoursesFound.title'), FlashMessage::WARNING); } $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $this->view->assignMultiple(['courses' => $courses, 'demand' => $demand, 'settings' => $this->settings, 'storagePid' => $configuration['persistence']['storagePid']]); }
/** * action list * * @param array $overwriteDemand * @return void */ public function listAction($overwriteDemand = NULL) { $demand = $this->createDemandFromSettings($this->settings); if ($overwriteDemand === NULL) { $overwriteDemand = $this->moduleData->getOverwriteDemand(); } else { $this->moduleData->setOverwriteDemand($overwriteDemand); } $this->overwriteDemandObject($demand, $overwriteDemand); $this->moduleData->setDemand($demand); $courses = $this->courseRepository->findDemanded($demand); if ($courses instanceof QueryResultInterface and !$courses->count() or !count($courses)) { $this->addFlashMessage($this->translate('message.noCoursesFound.text'), $this->translate('message.noCoursesFound.title'), FlashMessage::WARNING); } $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $templateVariables = ['courses' => $courses, 'demand' => $demand, 'overwriteDemand' => $overwriteDemand, 'filterOptions' => $this->getFilterOptions($this->settings['filter']), 'storagePid' => $configuration['persistence']['storagePid'], 'settings' => $this->settings]; $this->emitSignal(__CLASS__, self::COURSE_LIST_ACTION, $templateVariables); $this->view->assignMultiple($templateVariables); }