| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | #[Route('/user/profile', name: 'user_profile')] |
||
| 18 | public function profile(Request $request, EntityManagerInterface $entityManager): Response |
||
| 19 | { |
||
| 20 | /** @var User $user */ |
||
| 21 | $user = $this->getUser(); |
||
| 22 | $profile = $user->getProfile(); |
||
| 23 | $form = $this->createForm(ProfileType::class, $profile); |
||
| 24 | $form->handleRequest($request); |
||
| 25 | |||
| 26 | if ($form->isSubmitted() && $form->isValid()) { |
||
| 27 | $entityManager->persist($profile); |
||
| 28 | $entityManager->flush(); |
||
| 29 | $this->addFlash('success', 'message.updated'); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this->render('user/profile/profile.html.twig', [ |
||
| 33 | 'site' => $this->site($request), |
||
| 34 | 'form' => $form->createView(), |
||
| 35 | ]); |
||
| 38 |