src/Services/Transaction/Workflow/EventSubscriber/Sepa/Plais/PlaisSepaCctinitSubscriber.php line 31

Open in your IDE?
  1. <?php
  2. namespace App\Services\Transaction\Workflow\EventSubscriber\Sepa\Plais;
  3. use App\Services\SepaMessaging\Plais\CctinitService;
  4. use App\Entity\Transaction;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. use Symfony\Component\Workflow\Event\Event;
  7. class PlaisSepaCctinitSubscriber implements EventSubscriberInterface
  8. {
  9.     /**
  10.      * @var CctinitService
  11.      */
  12.     private $cctinitService;
  13.     public function __construct(
  14.         CctinitService $cctinitService
  15.     ) {
  16.         $this->cctinitService $cctinitService;
  17.     }
  18.     public static function getSubscribedEvents()
  19.     {
  20.         return [
  21.             'workflow.sepa_transaction_creating.completed.accept' => 'generateCardsta',
  22.             'workflow.sepa_transaction_creating.completed.reject' => 'generateCardsta',
  23.         ];
  24.     }
  25.     public function generateCardsta(Event $event)
  26.     {
  27.         /** @var Transaction $transaction */
  28.         $transaction $event->getSubject()->getEntity();
  29.         $this->cctinitService->generateCardsta($transaction);
  30.     }
  31. }