mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
DX: [absence] Remove unneccessary $em->persist()
This commit is contained in:
parent
9696a8194c
commit
b30e966316
@ -34,7 +34,6 @@ class AbsenceController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->persist($user);
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
|
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
|
||||||
@ -56,11 +55,9 @@ class AbsenceController extends AbstractController
|
|||||||
public function unsetAbsence(Request $request)
|
public function unsetAbsence(Request $request)
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$form = $this->createForm(AbsenceType::class, $user);
|
|
||||||
|
|
||||||
$user->setAbsenceStart(null);
|
$user->setAbsenceStart(null);
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->persist($user);
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
|
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user