/** * * @param string $filepath * @param \HDNET\Importr\Domain\Model\Strategy $strategy * * @return void */ public function createAction($filepath, Strategy $strategy) { $this->importService->addToQueue($filepath, $strategy); $text = 'The Import file %s width the strategy %s was successfully added to the queue'; $message = GeneralUtility::makeInstance(FlashMessage::class, sprintf($text, $filepath, $strategy->getTitle()), 'Import is in Queue', FlashMessage::INFO, true); $flashMessageService = $this->objectManager->get(FlashMessageService::class); $messageQueue = $flashMessageService->getMessageQueueByIdentifier(); $messageQueue->addMessage($message); $this->redirect('index'); }
/** * @param array $configuration * @return $this */ protected function createImport(array $configuration) { if (!isset($configuration['createImport']) && !is_array($configuration['createImport'])) { return $this; } foreach ($configuration['createImport'] as $create) { $strategy = $this->strategyRepository->findByUid((int) $create['importId']); if ($strategy instanceof Strategy) { $filepath = isset($create['filepath']) ? $create['filepath'] : ''; $this->importService->addToQueue($filepath, $strategy, $create); } } return $this; }