mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 01:55:01 +00:00
DX: [absence] Remove unneccessary $em->persist()
This commit is contained in:
@@ -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'));
|
||||||
|
Reference in New Issue
Block a user