Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function shareContactsAction($reply = 'no') |
||
26 | { |
||
27 | /** @var User */ |
||
28 | $user = $this->getUser(); |
||
29 | |||
30 | if ('yes' === $reply) { |
||
31 | $user->setAllowShareContacts(true); |
||
32 | } else { |
||
33 | $user->setAllowShareContacts(false); |
||
34 | } |
||
35 | |||
36 | $em = $this->getDoctrine()->getManager(); |
||
37 | $em->persist($user); |
||
38 | $em->flush(); |
||
39 | |||
40 | $url = $this->get('request_stack')->getCurrentRequest()->headers->get('referer'); |
||
41 | |||
42 | return new RedirectResponse($url); |
||
43 | } |
||
45 |