src/FlexApp/EventSubscriber/PortalNotifierAboutJobSeekerLeftChatSubscriber.php line 31

Open in your IDE?
  1. <?php
  2. namespace FlexApp\EventSubscriber;
  3. use FlexApp\Events\TokenEvent;
  4. use FlexApp\Events\UserLeftChatEvent;
  5. use FlexApp\Service\PortalNotifierAboutChatEvents;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. use WebBundle\Exception\PortalHelperException;
  8. class PortalNotifierAboutJobSeekerLeftChatSubscriber implements EventSubscriberInterface
  9. {
  10.     /**
  11.      * @var PortalNotifierAboutChatEvents
  12.      */
  13.     private $portalNotifierAboutChatEvents;
  14.     /**
  15.      * @param PortalNotifierAboutChatEvents $portalNotifierAboutChatEvents
  16.      */
  17.     public function __construct(PortalNotifierAboutChatEvents $portalNotifierAboutChatEvents)
  18.     {
  19.         $this->portalNotifierAboutChatEvents $portalNotifierAboutChatEvents;
  20.     }
  21.     /**
  22.      * @param TokenEvent $event
  23.      *
  24.      * @throws PortalHelperException
  25.      */
  26.     public function onUserLeftChatEvent(TokenEvent $event)
  27.     {
  28.         $this->portalNotifierAboutChatEvents->notify($event'Соискатель вышел из чата');
  29.     }
  30.     public static function getSubscribedEvents()
  31.     {
  32.         return [
  33.             UserLeftChatEvent::class => 'onUserLeftChatEvent',
  34.         ];
  35.     }
  36. }