preference = new Preferences(); } #[Route(path: '/notification', name: 'notification', methods: ['GET'])] public function mail(): Response { try { $notificationGateway = new NotificationGateway(new Connexion(DSN, DB_USER, DB_PASSWORD)); $listSearch = $notificationGateway->getNotifications(); $map = new NotificationMapper(); $notificationEntity = $map->notificationSqlToEntity($listSearch); $listUsers = []; 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()]; } $response = $this->render('./page/notification.html.twig',[ 'css' => $this->preference->getCookie(), 'pp' => "test2", 'user' => "Doe", 'role' => "Athlète", 'friendship' => [], 'analyzes' => [], 'mails' => $listUsers, 'users' => [], 'infoUser' => [], 'exos' => [], 'member' => [] ]); } catch (\Throwable $th) { throw $th; return $this->render("notification.html.twig", ['tabError' => $taberror]); } return $response; } }