Use PostUpdateEventArgs typing instead of PostPersistEventArgs

This commit is contained in:
Julie Lenaerts 2023-11-29 11:30:14 +01:00 committed by Julien Fastré
parent 9ba557a5bf
commit 15f8432ce0
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -16,7 +16,7 @@ use Chill\MainBundle\Entity\NotificationComment;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Repository\NotificationRepository; use Chill\MainBundle\Repository\NotificationRepository;
use Chill\MainBundle\Templating\UI\NotificationCounterInterface; use Chill\MainBundle\Templating\UI\NotificationCounterInterface;
use Doctrine\ORM\Event\PostPersistEventArgs; use Doctrine\ORM\Event\PostUpdateEventArgs;
use Doctrine\ORM\Event\PreFlushEventArgs; use Doctrine\ORM\Event\PreFlushEventArgs;
use Psr\Cache\CacheItemPoolInterface; use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserInterface;
@ -62,7 +62,7 @@ final readonly class NotificationByUserCounter implements NotificationCounterInt
return 'chill_main_notif_unread_by_'.$user->getId(); return 'chill_main_notif_unread_by_'.$user->getId();
} }
public function onEditNotificationComment(NotificationComment $notificationComment, PostPersistEventArgs $eventArgs): void public function onEditNotificationComment(NotificationComment $notificationComment, PostUpdateEventArgs $eventArgs): void
{ {
$this->resetCacheForNotification($notificationComment->getNotification()); $this->resetCacheForNotification($notificationComment->getNotification());
} }