src/EventSubscriber/OrderProcessSubscriber.php line 15

  1. <?php
  2. namespace App\EventSubscriber;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Symfony\Component\Workflow\Event\GuardEvent;
  5. class OrderProcessSubscriber implements EventSubscriberInterface
  6. {
  7.     public function guardValidate(GuardEvent $event): void
  8.     {
  9. //        $event->setBlocked(true, 'En attente de validation.');
  10.     }
  11.     public function guardProcess(GuardEvent $event): void
  12.     {
  13. //        $event->setBlocked(true, 'En attente de paiement.');
  14.     }
  15.     public function guardClose(GuardEvent $event): void
  16.     {
  17. //        $event->setBlocked(true, 'En cours de traitement');
  18.     }
  19.     public static function getSubscribedEvents(): array
  20.     {
  21.         return [
  22.             'workflow.order_process.guard.validate' => 'guardValidate',
  23.             'workflow.order_process.guard.process'  => 'guardProcess',
  24.             'workflow.order_process.guard.close'    => 'guardClose',
  25.         ];
  26.     }
  27. }