Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function indexAction(Request $request) |
||
27 | { |
||
28 | $em = $this->getDoctrine()->getManager(); |
||
29 | $admin = $em->getRepository(Admin::class)->findOneBy(['id' => $this->getUser()->getId()]); |
||
30 | $editForm = $this->createForm(AdminType::class, $admin); |
||
31 | $editForm->handleRequest($request); |
||
32 | if ($editForm->isSubmitted()) { |
||
33 | if ($editForm->isValid()) { |
||
34 | $em->persist($admin); |
||
35 | $em->flush(); |
||
36 | } |
||
37 | } |
||
38 | return [ |
||
39 | "admin" => $admin, |
||
40 | "editForm" => $editForm->createView(), |
||
41 | ]; |
||
42 | } |
||
43 | } |
||
44 |