| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function logoutAction(Request $request) |
||
| 36 | { |
||
| 37 | $apiKeyHead=$request->headers->get('API-Key-Token'); |
||
| 38 | |||
| 39 | $response = [ |
||
| 40 | '204' => 'Successful operation' |
||
| 41 | ]; |
||
| 42 | |||
| 43 | $em = $this->getDoctrine()->getManager(); |
||
| 44 | $customer = $em->getRepository('AppBundle:Customer') |
||
| 45 | ->findOneBy(['apiKey' => $apiKeyHead]); |
||
| 46 | $customer->setApiKey(null); |
||
| 47 | $em->flush(); |
||
| 48 | |||
| 49 | return View::create($response, 204); |
||
| 50 | } |
||
| 51 | |||
| 53 |