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; }
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; }
/** * @param int $position_id * @return \Fpl\Element\Position */ public function getPosition($position_id) { $position = new Element\Position(); $position->load($position_id); return $position; }