src/EventSubscriber/OrderProcessSubscriber.php line 20
<?php
namespace App\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\GuardEvent;
class OrderProcessSubscriber implements EventSubscriberInterface
{
public function guardValidate(GuardEvent $event): void
{
// $event->setBlocked(true, 'En attente de validation.');
}
public function guardProcess(GuardEvent $event): void
{
// $event->setBlocked(true, 'En attente de paiement.');
}
public function guardClose(GuardEvent $event): void
{
// $event->setBlocked(true, 'En cours de traitement');
}
public static function getSubscribedEvents(): array
{
return [
'workflow.order_process.guard.validate' => 'guardValidate',
'workflow.order_process.guard.process' => 'guardProcess',
'workflow.order_process.guard.close' => 'guardClose',
];
}
}