本文整理汇总了PHP中Club::get_club_id_by_short方法的典型用法代码示例。如果您正苦于以下问题:PHP Club::get_club_id_by_short方法的具体用法?PHP Club::get_club_id_by_short怎么用?PHP Club::get_club_id_by_short使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Club
的用法示例。
在下文中一共展示了Club::get_club_id_by_short方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_fixture_id
public static function get_fixture_id($round, $date, $team)
{
$query = "SELECT id FROM fixture WHERE gameweek = %d AND kickoff_time = %s AND";
$team = explode(" ", $team);
$team = explode("(", $team[0]);
$team_id = Club::get_club_id_by_short($team[0]);
if (strpos($team[1], "A") === false) {
// playing at home
$query = $query . " away_team = %d";
} else {
// playing away
$query = $query . " home_team = %d";
}
$query = $query . " LIMIT 1";
$result = DB::query($query, $round, Fixture::convert_kickoff_time($date), $team_id);
if (sizeof($result) == 1) {
return (int) $result[0]['id'];
}
return false;
}
示例2: set_opponent
function set_opponent($opponent, $team)
{
$data = explode(" ", $opponent);
$opp = explode("(", $data[0]);
if (strpos($opp[1], "H") !== false) {
// home game
$this->set_home_team($team);
$this->set_away_team(Club::get_club_id_by_short($opp[0]));
} else {
$this->set_home_team(Club::get_club_id_by_short($opp[0]));
$this->set_away_team($team);
}
// fucking retarded api have to do this shit...
if (sizeof($data) == 2) {
// fixture played
$goals = explode("-", $data[1]);
if (sizeof($goals) == 1) {
// cant set goals since game hasnt been played for the round
$this->set_played(0);
$this->set_home_goals(NULL);
$this->set_away_goals(NULL);
return;
} else {
$this->set_played(1);
}
if ($this->get_home_team() == $team) {
// 1-0 home win
$this->set_home_goals((int) $goals[0]);
$this->set_away_goals((int) $goals[1]);
} else {
//0-1 away loss
$this->set_home_goals((int) $goals[1]);
$this->set_away_goals((int) $goals[0]);
}
}
}