['transferImages', EventPriorities::POST_WRITE], ]; } /** * @throws TransportExceptionInterface * @throws ServerExceptionInterface * @throws RedirectionExceptionInterface * @throws ClientExceptionInterface */ public function transferImages(ViewEvent $event): void { $imageRepositoryOutput = $event->getControllerResult(); $method = $event->getRequest()->getMethod(); if (!$imageRepositoryOutput instanceof ImageRepositoryOutput || $method != Request::METHOD_POST) { return; } $imagesToImport = $this->entityManager->getRepository(Image::class)->findBy(['isGlobal' => true]); foreach($imagesToImport as $imageToImport) { //$this->transferIsGlobalAction->__invoke($imageRepositoryOutput->getEntity()); } } }