Пример #1
0
 private function getOrCreateMatchForToday()
 {
     $date_from = Utilities::today_start();
     $date_to = Utilities::today_end();
     $today_match = Match::getMatchByDateRange($date_from, $date_to);
     if (is_null($today_match)) {
         $match_date_time = date("Y-m-d " . $this->venue->getVenueDefaultHour() . ":00");
         $today_match = new Match();
         $today_match->setVenueId($this->venue->getVenueId());
         $today_match->setPlayerCount(0);
         $today_match->setMatchDateTime($match_date_time);
         $today_match->setStatus(MatchLogic::STATUS_LFM);
         $today_match->persist();
     }
     return $today_match;
 }