1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
public function updateState(EntityManagerInterface $em, Request $request) {
$id = $request->get("id");
$valider = $request->get("valider");
$absencesJustifications = $em->getRepository(AbsencesJustifications::class)->find($id);
if (!$absencesJustifications) {
throw $this->createNotFoundException(
"L'entité $id n'existe pas"
);
}
$absencesJustifications->setValider( $valider ); // à condition que setValider() existe dans l'entité
$em->flush();
return new Response(
'There are no jobs in the database',
Response::HTTP_OK
);
} |