| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function getCurrentUserByApiKey(): Customer |
||
| 25 | { |
||
| 26 | $em = $this->doctrine->getEntityManager(); |
||
| 27 | $apiKey = $this->requestStack->getCurrentRequest()->headers->get('API-Key-Token'); |
||
| 28 | $customer = $em |
||
| 29 | ->getRepository('AppBundle:Customer') |
||
| 30 | ->findOneBy(['apiKey' => $apiKey]); |
||
| 31 | |||
| 32 | return $customer; |
||
| 33 | } |
||
| 34 | } |
||
| 35 |