public function testOnTournamentFinish()
 {
     $event = new TournamentContainer();
     $tournament = $this->container->get("core.handler.tournament")->getRepository()->find(2163);
     $event->setTournament($tournament);
     $this->service->onTournamentFinish($event);
 }
Пример #2
0
 /**
  * @param TournamentContainer $tournamentContainer
  */
 public function onTournamentFinish(TournamentContainer $tournamentContainer)
 {
     $tournament = $tournamentContainer->getTournament();
     if ($tournament->getTournamentParams()->getType() != TournamentType::ROUND_ROBIN()) {
         return;
     }
     $this->container->get("core.service.tournament_table.factory")->create($tournament->getTournamentParams()->getType())->mixTournamentTable($tournament);
     $this->container->get("immortalchessnet.service.publish")->publishNewPost(new Post($this->container->getParameter("app_immortalchess.forum_playzone"), self::THREAD_FOR_TOURNAMENT_RESULTS, $this->container->getParameter("app_immortalchess.post_username_for_calls"), $this->container->getParameter("app_immortalchess.post_userid_for_calls"), "Турнир #{$tournament->getName()} завершен", $this->container->get("templating")->render("Post/tournamenttable_round_robin.html.twig", ["tournament" => $tournament])));
 }
Пример #3
0
 /**
  * @param TournamentContainer $tournamentContainer
  */
 public function onTournamentStart(TournamentContainer $tournamentContainer)
 {
     $tournament = $tournamentContainer->getTournament();
     $this->removeOfflinePlayers($tournament);
     $this->changeTournamentStatus($tournament, TournamentStatus::CURRENT());
     $this->calculateRounds($tournament);
     $this->manager->flush($tournament);
 }