当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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;
 }
开发者ID:dpalecek,项目名称:epl-scraper,代码行数:20,代码来源:DataPlayerFixture.php

示例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]);
         }
     }
 }
开发者ID:dpalecek,项目名称:epl-scraper,代码行数:36,代码来源:DataHistoricalFixture.php


注:本文中的Club::get_club_id_by_short方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。