From db633e71d76c0a015df50711571592d4902a6b20 Mon Sep 17 00:00:00 2001 From: Kevin Monteiro Date: Wed, 10 Jan 2024 14:24:27 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20bug=20Messagerie=20;;;=20Pote?= =?UTF-8?q?ntiellement=20un=20bug=20sur=20mauvais=20id=20de=20celui=20qui?= =?UTF-8?q?=20envoie=20la=20notif?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/src/app/controller/SocialController.php | 3 ++- .../src/app/views/Templates/page/notification.html.twig | 4 ++-- Sources/src/data/core/database/NotificationEntity.php | 2 +- Sources/src/data/core/database/NotificationMapper.php | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Sources/src/app/controller/SocialController.php b/Sources/src/app/controller/SocialController.php index f2867f55..765b8ca3 100644 --- a/Sources/src/app/controller/SocialController.php +++ b/Sources/src/app/controller/SocialController.php @@ -33,12 +33,13 @@ class SocialController extends BaseController $notificationEntity = $map->notificationSqlToEntity($listSearch); $listUsers = []; + //log::dd($notificationEntity); foreach ($notificationEntity as $entity) { $notification = $map->notificationEntityToModel($entity); $listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(), 'date' => $notification->getDate()->format("D j F Y"),'statut' => $notification->getStatut(), 'urgence' => $notification->getUrgence(), - 'idathlete' => $notification->getToUserId()]; + 'athleteId' => $notification->getToUserId()]; } $response = $this->render('./page/notification.html.twig',[ diff --git a/Sources/src/app/views/Templates/page/notification.html.twig b/Sources/src/app/views/Templates/page/notification.html.twig index 9f84ee37..42216d3c 100755 --- a/Sources/src/app/views/Templates/page/notification.html.twig +++ b/Sources/src/app/views/Templates/page/notification.html.twig @@ -29,8 +29,8 @@ {% for mail in mails %} - - {{mail.idathlete}} + + {{mail.athleteId}} {{mail.message}} {{ mail.date }} diff --git a/Sources/src/data/core/database/NotificationEntity.php b/Sources/src/data/core/database/NotificationEntity.php index 69ecfbf9..986982f0 100644 --- a/Sources/src/data/core/database/NotificationEntity.php +++ b/Sources/src/data/core/database/NotificationEntity.php @@ -13,7 +13,7 @@ class NotificationEntity private $urgence; private $idAthlete; - public function getIdNotif(): int + public function getIdNotif() { return $this->idNotif; } diff --git a/Sources/src/data/core/database/NotificationMapper.php b/Sources/src/data/core/database/NotificationMapper.php index 51622e96..7fe24a65 100644 --- a/Sources/src/data/core/database/NotificationMapper.php +++ b/Sources/src/data/core/database/NotificationMapper.php @@ -16,8 +16,8 @@ class NotificationMapper foreach ($data as $notificationData) { $notification = new NotificationEntity(); - if (isset($notificationData['idnotif'])) { - $notification->setIdNotif($notificationData['idnotif']); + if (isset($notificationData['idNotif'])) { + $notification->setIdNotif($notificationData['idNotif']); } if (isset($notificationData['message'])) { @@ -36,8 +36,8 @@ class NotificationMapper $notification->setUrgence($notificationData['urgence']); } - if (isset($notificationData['athleteid'])) { - $notification->setIdAthlete($notificationData['athleteid']); + if (isset($notificationData['athleteId'])) { + $notification->setIdAthlete($notificationData['athleteId']); } $notificationEntities[] = $notification;