/** * Retrieve Domain details * @Route("/tournament-detail/{id}", name="tournament_showdetail") * @Method("GET") */ public function showdetail(Tournament $tournament) { //get all groups with tournament id in group table $em = $this->getDoctrine()->getManager(); $groups = $em->getRepository("CricketBundle\\Model\\Entity\\Groups")->findBy(array('tournament' => $tournament->getId())); //get all teams with group id in groups_team table foreach ($groups as $group) { $teamsingroup = $group->getTeam(); echo "</b>" . $group->getGroupname() . "</b></br>"; foreach ($teamsingroup as $teamingroup) { echo $teamingroup->getTeam() . "</br>"; } } //get all matches with tournament id //get opposing teams in matches return $this->render("Cricket/Tournament/tournamentdetail.html.twig", array('tournament' => $tournament, 'groups' => $groups)); }
/** * Set tournament * * @param \CricketBundle\Model\Entity\Tournament $tournament * * @return Groups */ public function setTournament(\CricketBundle\Model\Entity\Tournament $tournament = null) { $tournament->addGroup($this); $this->tournament = $tournament; return $this; }