eventRepository = $eventRepository; } /** * @param DataProcessingForModels $dataProcessing */ public function injectDataProcessingForModels(DataProcessingForModels $dataProcessing) { $this->dataProcessing = $dataProcessing; } /** * Action initializer */ protected function initializeAction() { $this->dataProcessing->setConfigurationManager($this->configurationManager); $this->pluginSettings = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK ); } /** * Action list * * @return void */ public function listAction() { $demand = $this->createDemandFromSettings(); $events = $this->eventRepository->findByDemand($demand); $this->view->assign('events', $events); } /** * Action show * * @Extbase\IgnoreValidation("event") * * @param Event $event * @return void */ public function showAction(Event $event) { $this->view->assign('event', $event); } /** * action teaser * * @return void */ public function teaserAction() { $events = $this->eventRepository->findByUids($this->settings['eventUids']); $this->view->assign('events', $events); } /** * @param string $search */ public function searchAction(): void { $search = ''; if ($this->request->hasArgument('search')) { $search = $this->request->getArgument('search'); } $this->view->assign('search', $search); $this->view->assign('events', $this->eventRepository->findSearchWord($search)); } /** * @return EventDemand */ protected function createDemandFromSettings(): EventDemand { /** @var EventDemand $demand */ $demand = $this->objectManager->get(EventDemand::class); $demand->setRegion((string)$this->settings['region']); $demand->setCategories((string)$this->settings['categories']); $categoryCombination = (int)$this->settings['categoryCombination'] === 1 ? 'or' : 'and'; $demand->setCategoryCombination($categoryCombination); $demand->setIncludeSubCategories((bool)$this->settings['includeSubcategories']); $demand->setSortBy((string)$this->settings['sortByEvent']); $demand->setSortOrder((string)$this->settings['sortOrder']); $demand->setHighlight((bool)$this->settings['highlight']); $demand->setRecordUids(GeneralUtility::intExplode(',', $this->settings['selectedRecords'], true)); if (!empty($this->settings['limit'])) { $demand->setLimit($this->settings['limit']); } return $demand; } }