| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function singleEventAction($id) |
||
| 44 | { |
||
| 45 | /** @var Event $event */ |
||
| 46 | $event = $this->getDoctrine()->getRepository('AppBundle:Event') |
||
| 47 | ->findByGoogleId($id); |
||
| 48 | $user = $event->getUser(); |
||
| 49 | if (!$user) { |
||
| 50 | throw new JsonHttpException(404, 'User not found.'); |
||
| 51 | } |
||
| 52 | $googleEvent = $this->get('app.google_calendar') |
||
| 53 | ->getEventById($id); |
||
| 54 | $event = new DtoEvent($googleEvent); |
||
| 55 | |||
| 56 | return new JsonResponse(['event' => $event]); |
||
| 57 | } |
||
| 58 | } |
||
| 59 |