use NotificationPersister into PersonMoveEventSubscriber

This commit is contained in:
2022-04-22 12:12:50 +02:00
parent 2d9af8f8c0
commit 354f130e9e
3 changed files with 26 additions and 27 deletions

View File

@@ -13,10 +13,10 @@ namespace Chill\PersonBundle\AccompanyingPeriod\Events;
use Chill\MainBundle\Entity\Address;
use Chill\MainBundle\Entity\Notification;
use Chill\MainBundle\Notification\NotificationPersisterInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Event\Person\PersonAddressMoveEvent;
use DateTimeImmutable;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Templating\EngineInterface;
@@ -26,7 +26,7 @@ class PersonAddressMoveEventSubscriber implements EventSubscriberInterface
{
private EngineInterface $engine;
private EntityManagerInterface $entityManager;
private NotificationPersisterInterface $notificationPersister;
private Security $security;
@@ -34,12 +34,12 @@ class PersonAddressMoveEventSubscriber implements EventSubscriberInterface
public function __construct(
EngineInterface $engine,
EntityManagerInterface $entityManager,
NotificationPersisterInterface $notificationPersister,
Security $security,
TranslatorInterface $translator
) {
$this->engine = $engine;
$this->entityManager = $entityManager;
$this->notificationPersister = $notificationPersister;
$this->security = $security;
$this->translator = $translator;
}
@@ -87,7 +87,7 @@ class PersonAddressMoveEventSubscriber implements EventSubscriberInterface
'period' => $period,
]));
$this->entityManager->persist($notification);
$this->notificationPersister->persist($notification);
}
}
}