Esempio n. 1
0
 public static function deleteMatchesForFop($fop_id)
 {
     Match::where('match_found_person', '=', true)->where('match_table_id', '=', $fop_id)->delete();
 }
 /**
  * Calculates the score for this entry's match predictions.
  */
 private function calculateMatchPredictionsScore()
 {
     $score = 0;
     foreach ($this->matchPredictions as $match_prediction) {
         $match = Match::where('team_a', $match_prediction->team_a)->where('team_b', $match_prediction->team_b)->first();
         if ($match && $match->result && $match->result == $match_prediction->result) {
             $score = $score + self::GROUP_MATCH_SCORE;
         }
     }
     return $score;
 }
Esempio n. 3
0
 public function Matches()
 {
     return Match::where('teamA_id', '=', $this->id)->orWhere('teamB_id', '=', $this->id)->get();
 }