<?php
/*
* @since 1.0.0
* @copyright Copyright (C) 2020 ArtMedia. All rights reserved.
* @website http://artmedia.biz.pl
* @author Arkadiusz Tobiasz
* @email kontakt@artmedia.biz.pl
*/
namespace App\EventSubscriber\Profile;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use App\Events\Core\NotificationAddEvent;
use Symfony\Contracts\Translation\TranslatorInterface;
use App\Entity\Profile\Travel;
class NotificationSubscriber implements EventSubscriberInterface
{
private $translator;
public function __construct(
TranslatorInterface $translator
) {
$this->translator = $translator;
}
public static function getSubscribedEvents(): array
{
return [
NotificationAddEvent::NAME => 'onNotificationAddEvent',
];
}
public function onNotificationAddEvent(NotificationAddEvent $event): void
{
$event->addNotification(Travel::RADIUS_NOTIFICATION, $this->translator->trans('Someone I follow arranges a travel in my area', [], 'email_notification'));
}
}