distance) && $this->distance instanceof Distance) { $flight['distance'] = $this->distance->toObject(); } $flight['airline'] = new Airline($this->airline); $flight['subfleets'] = Subfleet::collection($this->subfleets); return $flight; } }