Example #1
0
 /**
  * Lists all Race entities.
  *
  * @Route("/event/{event}/races/{onlyThoseThatCanBeStarted}", name="race_index")
  * @Method("GET")
  */
 public function indexAction(Event $event, $onlyThoseThatCanBeStarted = false)
 {
     $em = $this->getDoctrine()->getManager();
     /** @var RaceRepository $repo */
     $repo = $em->getRepository('AppBundle:Race');
     if ($onlyThoseThatCanBeStarted) {
         $races = $repo->getAllRacesThatHaveRegistrations($event->getId());
     } else {
         $races = $event->getRaces();
     }
     return $this->render('race/index.html.twig', array('races' => $races, 'event' => $event, 'rr' => $repo, 'filtered' => $onlyThoseThatCanBeStarted));
 }