コード例 #1
0
 private function processResponseObject(ResponseObject $object)
 {
     if ($object->getEntityName() == "Driver") {
         $newDriver = new Driver();
         $newDriver->fromArray($object->getFields());
         $this->add($newDriver);
         return $newDriver;
     } else {
         return false;
     }
 }
コード例 #2
0
ファイル: LapCollection.php プロジェクト: sam-higton/F1Data
 public function processResponseObject(ResponseObject $object)
 {
     $fields = $object->getFields();
     $timingArray = [];
     foreach ($fields['timings']->getCollection() as $timing) {
         $timingArray[] = $timing->getFields();
     }
     $fields['timings'] = $timingArray;
     $lap = new Lap();
     $lap->fromArray($fields);
     $this->add($lap);
 }