security->getUser(); $exportRequest->setRequesterId($access->getId()); if ($exportRequest->isAsync()) { // Send the export request to Messenger (@see App\Message\Handler\ExportHandler) $this->messageBus->dispatch( new Export($exportRequest) ); return new Response(null, 204); } $exportService = $this->handler->getExporterFor($exportRequest); $file = $exportService->export($exportRequest); return new Response('File generated: ' . $file->getId(), 200); } /** * @throws Exception */ public function remove($data, array $context = []) { throw new Exception('not supported', 500); } }