home_id, $value->away_id, $value->gls_h, $value->gls_a, $match); public static function sort(string $similar_past_matches, array &$result, string $bettype, int $home_id, int $away_id, float $val_home, float $val_away, object $match) { /** * takes values form statistiko_conf table * there are 2 mthods A and B noe running B hardcodet */ if ($similar_past_matches != 'none') { $result[$bettype.'_home_made_total'][] = $val_home; $result[$bettype.'_away_made_total'][] = $val_away; } elseif (ExpectationsTeam::$collectionMethod == 'B') { // TEAM HOME if ($match->home_id == $home_id) { self::add($result, 'team_home', $bettype, 'scored', 'home', $val_home); self::add($result, 'team_home', $bettype, 'conceded', 'home', $val_away); } if ($match->home_id == $away_id) { self::add($result, 'team_home', $bettype, 'scored', 'away', $val_away); self::add($result, 'team_home', $bettype, 'conceded', 'away', $val_home); } // TEAM AWAY if ($match->away_id == $home_id) { self::add($result, 'team_away', $bettype, 'scored', 'home', $val_home); self::add($result, 'team_away', $bettype, 'conceded', 'home', $val_away); } if ($match->away_id == $away_id) { self::add($result, 'team_away', $bettype, 'scored', 'away', $val_away); self::add($result, 'team_away', $bettype, 'conceded', 'away', $val_home); } } else { if ($home_id == $match->home_id) { $result[$bettype.'_home_made_total'][] = $val_home; $result[$bettype.'_home_made_home'][] = $val_home; $result[$bettype.'_home_got_total'][] = $val_away; $result[$bettype.'_home_got_home'][] = $val_away; } elseif ($away_id == $match->home_id) { $result[$bettype.'_home_made_total'][] = $val_away; $result[$bettype.'_home_got_total'][] = $val_away; } elseif ($home_id == $match->away_id) { $result[$bettype.'_home_made_total'][] = $val_away; $result[$bettype.'_home_got_total'][] = $val_away; } elseif ($away_id == $match->away_id) { $result[$bettype.'_home_made_total'][] = $val_home; $result[$bettype.'_home_made_home'][] = $val_home; $result[$bettype.'_home_got_total'][] = $val_away; $result[$bettype.'_home_got_home'][] = $val_home; } if ($away_id == $match->away_id) { $result[$bettype.'_away_made_total'][] = $val_away; $result[$bettype.'_away_made_home'][] = $val_away; $result[$bettype.'_away_got_total'][] = $val_home; $result[$bettype.'_away_got_home'][] = $val_home; } elseif ($home_id == $match->away_id) { $result[$bettype.'_away_made_total'][] = $val_home; $result[$bettype.'_away_got_total'][] = $val_home; } elseif ($away_id == $match->home_id) { $result[$bettype.'_away_made_total'][] = $val_home; $result[$bettype.'_away_got_total'][] = $val_home; } elseif ($home_id == $match->home_id) { $result[$bettype.'_away_made_total'][] = $val_away; $result[$bettype.'_away_made_home'][] = $val_away; $result[$bettype.'_away_got_total'][] = $val_home; $result[$bettype.'_away_got_home'][] = $val_away; } } } }