private function processResponseObject(ResponseObject $object) { if ($object->getEntityName() == "Driver") { $newDriver = new Driver(); $newDriver->fromArray($object->getFields()); $this->add($newDriver); return $newDriver; } else { return false; } }
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); }