示例#1
0
 public function populate($player)
 {
     $this->id = $player[0];
     $this->first_name = $player[3];
     $this->last_name = $player[4];
     $this->display_name = $player[5];
     $team = new TeamSimple();
     $team->load($player[57]);
     $this->team = $team;
     $position = new Position();
     $position->load($player[56]);
     $this->position = $position;
 }
示例#2
0
文件: Element.php 项目: mlntn/fpl-api
 public function getPositions()
 {
     $positions = $this->getPositionsRaw();
     $return = [];
     foreach ($positions as $p) {
         if (is_null($p)) {
             continue;
         }
         $position = new Element\Position();
         $position->populate($p);
         $return[] = $position;
     }
     return $return;
 }
示例#3
0
文件: Api.php 项目: mlntn/fpl-api
 /**
  * @param int $position_id
  * @return \Fpl\Element\Position
  */
 public function getPosition($position_id)
 {
     $position = new Element\Position();
     $position->load($position_id);
     return $position;
 }