Exemple #1
0
 public function getRoundDrivers($year, $round)
 {
     $query = new ErgastQuery();
     $query->setDataType(ApiTypes::$DRIVER);
     $query->specifyYear($year);
     $query->specifyRound($round);
     $response = $this->makeRequest($query);
     return $this->formatDriverCollection($response->DriverTable->Driver);
 }
Exemple #2
0
 /**
  * @param $year
  * @param $round
  * @return mixed
  */
 public function getRoundLaps($year, $round)
 {
     $query = new ErgastQuery();
     $query->setDataType(ApiTypes::$LAP);
     $query->specifyYear($year);
     $query->specifyRound($round);
     $response = $this->makeRequest($query);
     return $this->formatLapsCollection($response->RaceTable->Race);
 }
Exemple #3
0
 /**
  * @param $year
  * @param $round
  * @return mixed
  */
 public function getRound($year, $round)
 {
     //test
     $query = new ErgastQuery();
     $query->setDataType(ApiTypes::$ROUND);
     $query->specifyYear($year);
     $query->specifyRound($round);
     $results = $this->makeRequest($query);
     return $this->formatRound($results->RaceTable->Race);
 }
Exemple #4
0
 public function getSeason($year)
 {
     $query = new ErgastQuery();
     $query->specifyYear($year);
     $response = $this->makeRequest($query);
 }
Exemple #5
0
 protected function makeRequest(ErgastQuery $query)
 {
     $result = $this->httpAdapter->get($query->buildRequestURI());
     return $result;
 }