Loading module/Oscar/src/Oscar/Entity/NotificationRepository.php +7 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,13 @@ class NotificationRepository extends EntityRepository return $qb->getQuery()->execute(); } public function removeNotificationsActivity(int $activityId) { foreach ($this->getNotificationsActivity($activityId) as $notification) { $this->getEntityManager()->remove($notification); } } public function purgeAll() { $dql = 'DELETE ' . Notification::class; Loading module/Oscar/src/Oscar/Service/NotificationService.php +10 −0 Original line number Diff line number Diff line Loading @@ -862,6 +862,16 @@ class NotificationService implements UseServiceContainer return $this->getNotificationRepository()->deleteNotificationsPerson($person->getId()); } public function deleteNotificationActivityById(int $activityId) { try { $this->getNotificationRepository()->removeNotificationsActivity($activityId); } catch (\Exception $e) { $this->getLoggerService()->err("Suppression des notifications pour l'activité '$activityId' : " . $e->getMessage()); } } /** * @param $personId * @return array Loading Loading
module/Oscar/src/Oscar/Entity/NotificationRepository.php +7 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,13 @@ class NotificationRepository extends EntityRepository return $qb->getQuery()->execute(); } public function removeNotificationsActivity(int $activityId) { foreach ($this->getNotificationsActivity($activityId) as $notification) { $this->getEntityManager()->remove($notification); } } public function purgeAll() { $dql = 'DELETE ' . Notification::class; Loading
module/Oscar/src/Oscar/Service/NotificationService.php +10 −0 Original line number Diff line number Diff line Loading @@ -862,6 +862,16 @@ class NotificationService implements UseServiceContainer return $this->getNotificationRepository()->deleteNotificationsPerson($person->getId()); } public function deleteNotificationActivityById(int $activityId) { try { $this->getNotificationRepository()->removeNotificationsActivity($activityId); } catch (\Exception $e) { $this->getLoggerService()->err("Suppression des notifications pour l'activité '$activityId' : " . $e->getMessage()); } } /** * @param $personId * @return array Loading