Résolution bug Messagerie ;;; Potentiellement un bug sur mauvais id de celui qui envoie la notif

merged_PLE
Kevin MONTEIRO 1 year ago
parent aa7de10a99
commit db633e71d7

@ -33,12 +33,13 @@ class SocialController extends BaseController
$notificationEntity = $map->notificationSqlToEntity($listSearch); $notificationEntity = $map->notificationSqlToEntity($listSearch);
$listUsers = []; $listUsers = [];
//log::dd($notificationEntity);
foreach ($notificationEntity as $entity) { foreach ($notificationEntity as $entity) {
$notification = $map->notificationEntityToModel($entity); $notification = $map->notificationEntityToModel($entity);
$listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(), $listUsers[] = ['idnotif' => $notification->getId(), 'message' => $notification->getMessage(),
'date' => $notification->getDate()->format("D j F Y"),'statut' => $notification->getStatut(), 'urgence' => $notification->getUrgence(), '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',[ $response = $this->render('./page/notification.html.twig',[

@ -29,8 +29,8 @@
<tbody> <tbody>
{% for mail in mails %} {% for mail in mails %}
<tr> <tr>
<td><img src="/assets/img/verif/{{mail.idnotif}}.png" width="25px" height="25px"></td> <td><img src="/assets/img/verif/{{mail.idNotif}}.png" width="25px" height="25px"></td>
<td>{{mail.idathlete}}</td> <td>{{mail.athleteId}}</td>
<td><a href="#">{{mail.message}}</a></td> <td><a href="#">{{mail.message}}</a></td>
<td>{{ mail.date }}</td> <td>{{ mail.date }}</td>
</tr> </tr>

@ -13,7 +13,7 @@ class NotificationEntity
private $urgence; private $urgence;
private $idAthlete; private $idAthlete;
public function getIdNotif(): int public function getIdNotif()
{ {
return $this->idNotif; return $this->idNotif;
} }

@ -16,8 +16,8 @@ class NotificationMapper
foreach ($data as $notificationData) { foreach ($data as $notificationData) {
$notification = new NotificationEntity(); $notification = new NotificationEntity();
if (isset($notificationData['idnotif'])) { if (isset($notificationData['idNotif'])) {
$notification->setIdNotif($notificationData['idnotif']); $notification->setIdNotif($notificationData['idNotif']);
} }
if (isset($notificationData['message'])) { if (isset($notificationData['message'])) {
@ -36,8 +36,8 @@ class NotificationMapper
$notification->setUrgence($notificationData['urgence']); $notification->setUrgence($notificationData['urgence']);
} }
if (isset($notificationData['athleteid'])) { if (isset($notificationData['athleteId'])) {
$notification->setIdAthlete($notificationData['athleteid']); $notification->setIdAthlete($notificationData['athleteId']);
} }
$notificationEntities[] = $notification; $notificationEntities[] = $notification;

Loading…
Cancel
Save