mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
fixup! Add message handling for public view creation
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Workflow\Messenger;
|
||||
|
||||
use Chill\MainBundle\Repository\EntityWorkflowSendViewRepository;
|
||||
use Chill\MainBundle\Workflow\WorkflowTransitionContextDTO;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
@@ -32,6 +33,7 @@ final readonly class PostPublicViewMessageHandler implements MessageHandlerInter
|
||||
private EntityWorkflowSendViewRepository $sendViewRepository,
|
||||
private Registry $registry,
|
||||
private LoggerInterface $logger,
|
||||
private EntityManagerInterface $entityManager,
|
||||
) {}
|
||||
|
||||
public function __invoke(PostPublicViewMessage $message): void
|
||||
@@ -51,6 +53,8 @@ final readonly class PostPublicViewMessageHandler implements MessageHandlerInter
|
||||
'entityWorkflow' => $entityWorkflow->getId(),
|
||||
]);
|
||||
|
||||
$this->entityManager->clear();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,6 +74,9 @@ final readonly class PostPublicViewMessageHandler implements MessageHandlerInter
|
||||
'transition' => $placeMetadata[self::TRANSITION_ON_VIEW],
|
||||
]);
|
||||
|
||||
$this->entityManager->flush();
|
||||
$this->entityManager->clear();
|
||||
|
||||
return;
|
||||
}
|
||||
$this->logger->info(self::LOG_PREFIX.'Not able to apply this transition', ['transition' => $placeMetadata[self::TRANSITION_ON_VIEW],
|
||||
@@ -77,5 +84,7 @@ final readonly class PostPublicViewMessageHandler implements MessageHandlerInter
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->entityManager->clear();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user