get('page') ?? 0; return $this->render( 'index.html.twig', [ 'tournamentList' => $this->tournamentRepository->getTournamentList($page), 'tournamentCount' => $this->tournamentRepository->getTotalTournament(), 'page' => $page, 'tournamentPerPage' => TournamentRepository::TOURNAMENT_PER_PAGE ] ); } #[Route(path: '/tournament/{tournamentId}', name: 'tournament_get', methods: ['GET'])] public function getTournament($tournamentId): Response { $tournament = $this->tournamentRepository->find($tournamentId); $isQualifyingGameEnd = true; foreach ($tournament->getDivisionList() as $division) { $this->qualifyingGameService->scheduleGames($division); $isQualifyingGameEnd = $this->qualifyingGameService->isQualificationGamesComplete($division) && $isQualifyingGameEnd; } if ($isQualifyingGameEnd) { $qualificationWinners = $this->qualifyingGameService->getQualificationGameWinners($tournament); $this->playOffGameService->scheduleGames($tournament, $qualificationWinners); } return $this->render( 'tournament.html.twig', ['tournament' => $tournament] ); } #[Route(path: '/tournament', name: 'tournament_create', methods: ['POST'])] public function createTournament() { return $this->redirectToRoute('tournament_list'); } }