src/EventSubscriber/Quote/RequestForQuoteWorkflowSubscriber.php line 35

  1. <?php
  2. namespace App\EventSubscriber\Quote;
  3. use Symfony\Component\HttpFoundation\RequestStack;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Symfony\Component\EventDispatcher\GenericEvent;
  6. use Webmozart\Assert\Assert;
  7. use Sylius\Component\Customer\Model\CustomerInterface;
  8. use App\Repository\Customer\CustomerRepository;
  9. use App\Entity\Channel\ChannelEcodaAccountInfo;
  10. use App\Repository\Channel\ChannelEcodaAccountInfoRepository;
  11. use App\Repository\Channel\ChannelEcodaAccountTypeRepository;
  12. use Doctrine\ORM\EntityManagerInterface;
  13. use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
  14. use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
  15. use App\Manager\EcodaAccountManager;
  16. use App\Entity\Quote\RequestForQuote
  17. use Symfony\Component\Workflow\Registry;
  18. use Symfony\Component\Workflow\Event\Event;
  19. class RequestForQuoteWorkflowSubscriber  implements EventSubscriberInterface
  20.     private $mailer
  21.     private $em;
  22.     private $workflows;
  23.     private $smsSender;
  24.     public function __construct(EntityManagerInterface $em,  Registry $workflows)
  25.     {
  26.         $this->em $em;
  27.         $this->workflows $workflows
  28.     }
  29.     public function onRequestMoreInformationCompleted(Event $event)
  30.     {  
  31.         $entity $event->getSubject();
  32.         Assert::isInstanceOf($entityRequestForQuote::class); 
  33.          
  34.     }  
  35.     public static function getSubscribedEvents()
  36.     {
  37.         return [
  38.             'workflow.request_for_quote.completed.request_more_information' => 'onRequestMoreInformationCompleted'
  39.         ];
  40.     }
  41. }