Loading module/Evenementiel/src/Controller/InscriptionController.php +5 −1 Original line number Diff line number Diff line Loading @@ -305,7 +305,11 @@ class InscriptionController extends AbstractActionController if ($this->getRequest()->isPost()) { $data = $this->getRequest()->getPost(); if ($data["reponse"] === "oui") { // $this->getInscriptionService()-> if ($this->getInscriptionService()->deleteInscriptionPlace($inscription, $inscriptionPlace)) { $this->flashMessenger()->addSuccessMessage("La place a été supprimé."); } else { $this->flashMessenger()->addWarningMessage("La place n'a pas été supprimé."); } } exit(); } Loading module/Evenementiel/src/Service/Inscription/InscriptionService.php +16 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,22 @@ class InscriptionService return $place; } public function deleteInscriptionPlace(Inscription $inscription, InscriptionPlace $inscriptionPlace): bool { if($inscriptionPlace === null) return false ; $places = $inscription->getPlaces(); if($places->removeElement($inscriptionPlace)) { $inscription->setNombrePlacesDemandees($inscription->getNombrePlacesDemandees() - 1); $this->update($inscription); return true; } return false ; } /** * Get entities as options for a select input * Loading Loading
module/Evenementiel/src/Controller/InscriptionController.php +5 −1 Original line number Diff line number Diff line Loading @@ -305,7 +305,11 @@ class InscriptionController extends AbstractActionController if ($this->getRequest()->isPost()) { $data = $this->getRequest()->getPost(); if ($data["reponse"] === "oui") { // $this->getInscriptionService()-> if ($this->getInscriptionService()->deleteInscriptionPlace($inscription, $inscriptionPlace)) { $this->flashMessenger()->addSuccessMessage("La place a été supprimé."); } else { $this->flashMessenger()->addWarningMessage("La place n'a pas été supprimé."); } } exit(); } Loading
module/Evenementiel/src/Service/Inscription/InscriptionService.php +16 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,22 @@ class InscriptionService return $place; } public function deleteInscriptionPlace(Inscription $inscription, InscriptionPlace $inscriptionPlace): bool { if($inscriptionPlace === null) return false ; $places = $inscription->getPlaces(); if($places->removeElement($inscriptionPlace)) { $inscription->setNombrePlacesDemandees($inscription->getNombrePlacesDemandees() - 1); $this->update($inscription); return true; } return false ; } /** * Get entities as options for a select input * Loading