Ajout de notif dans la BD

merging_APE
Paul LEVRAULT 1 year ago
parent 39f5026f99
commit d092f7c318

@ -93,7 +93,6 @@ class AthleteController extends BaseController
$listSearch = $athleteGateway->getAthlete($username);
$map = new AthleteMapper();
$athleteEntity = $map->athleteSqlToEntity($listSearch);
$listUsers = [];
foreach ($athleteEntity as $entity) {
$user = $map->athleteEntityToModel($entity);

@ -20,8 +20,8 @@ class NotificationGateway
}
public function addNotification(NotificationEntity $notif){
$query = "INSERT INTO Notification (idnotif, message, date, statut, urgence, athleteid) VALUES (:idNotif, :message, :date, :statut, :urgence, :idAthlete)";
$params = [':idNotif'=>$notif->getIdNotif(), ':message'=>$notif->getMessage(), ':date'=>$notif->getDate(), ':statut'=>$notif->getStatut(), ':urgence'=>$notif->getUrgence(), ':idAthlete'=>$notif->getIdAthlete()];
$query = "INSERT INTO Notification (message, date, statut, urgence, athleteid) VALUES (:message, :date, :statut, :urgence, :idAthlete)";
$params = [':message'=>$notif->getMessage(), ':date'=>$notif->getDate(), ':statut'=>$notif->getStatut(), ':urgence'=>$notif->getUrgence(), ':idAthlete'=>$notif->getIdAthlete()];
return $this->connection->executeWithErrorHandling($query, $params);
}
}
Loading…
Cancel
Save