/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { if ($event->getGameDate()->getWeek() != 1) { return; } foreach ($this->findAllLeagues() as $league) { $league->createFinalPositions($event->getGameDate()->getSeason() - 1); $league->resetStandings(); } }
/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { $matches = $this->fixtureRepository->findByGameDate($event->getGameDate()); foreach ($matches as $match) { $this->lineupService->createFixtureLineup($match); $this->matchEvaluationService->evaluateCompleteMatch($match); } }
/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { if (!in_array($event->getGameDate()->getWeek(), array(17, 34))) { return; } foreach ($this->findAllTeams() as $team) { foreach ($team->getPlayers() as $player) { $player->updateSkills(); } } }
/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { if ($event->getGameDate()->getWeek() == 1) { $this->fixtureService->createFixtures($event->getGameDate()->getSeason()); } }
/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { if ($event->getGameDate()->getWeek() == 1) { $this->transferOfferRepository->removeAll(); } }
/** * @param GameDateEvent $event */ public function execute(GameDateEvent $event) { foreach ($this->findAllTransferOffers() as $transferOffer) { $this->decideOnTransferOffer($transferOffer, $event->getGameDate()); } }
public function testGameDateEvent() { $gameDate = new GameDate(); $gameDateEvent = new GameDateEvent($gameDate); $this->assertEquals($gameDate, $gameDateEvent->getGameDate()); }