Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function activeEventAction() |
||
31 | { |
||
32 | $now = new \DateTime(); |
||
33 | $today = $now->format('Y-m-d'); |
||
34 | $time = $now->format('H:i'); |
||
35 | |||
36 | $events = $this->getDoctrine()->getRepository(Event::class)->findBy(['date' => $today]); |
||
37 | foreach ($events as $event) { |
||
38 | if ($event->getFeedbackStartTime() < $time && $event->getFeedbackEndTime() > $time) { |
||
39 | $event->loadTemplateIfSafe($this->getParameter('PUBLIC_DIR')); |
||
40 | |||
41 | return $this->returnEvent($event); |
||
42 | } |
||
43 | } |
||
44 | |||
45 | return $this->returnEvent(null); |
||
46 | } |
||
60 |