Exemplo n.º 1
0
 private function redirectMyUserPage(User $user)
 {
     if (!$user->isClub() || !$user->isRelated()) {
         // Non related users get a different view
         $rexp = new RedirectException();
         $rexp->setResponse($this->render('ICupPublicSiteBundle:User:mypage_nonrel.html.twig', array_merge(array('currentuser' => $user), $this->getTournaments())));
         throw $rexp;
     }
 }
Exemplo n.º 2
0
 /**
  * Get the current selcted tournament
  * @return Tournament
  */
 public function getTournament()
 {
     $tournamentKey = $this->getTournamentKey();
     if ($tournamentKey == '_') {
         $rexp = new RedirectException();
         $url = $this->container->get('router')->generate('_tournament_select');
         $rexp->setResponse(new RedirectResponse($url));
         throw $rexp;
     }
     return $this->logic->getTournamentByKey($tournamentKey);
 }