src/FlexApp/EventSubscriber/PortalNotifierAboutJobSeekerHasEnteredTheChatSubscriber.php line 30

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