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. { 
  21.     private $mailer; 
  22.     private $em;
  23.     private $workflows;
  24.     private $smsSender;
  25.     public function __construct(EntityManagerInterface $em,  Registry $workflows)
  26.     {
  27.         $this->em = $em;
  28.         $this->workflows = $workflows; 
  29.     }
  30.     public function onRequestMoreInformationCompleted(Event $event)
  31.     {  
  32.         $entity = $event->getSubject();
  33.         Assert::isInstanceOf($entity, RequestForQuote::class); 
  34.          
  35.     }  
  36.     public static function getSubscribedEvents()
  37.     {
  38.         return [
  39.             'workflow.request_for_quote.completed.request_more_information' => 'onRequestMoreInformationCompleted'
  40.         ];
  41.     }
  42. }