| @@ 78-93 (lines=16) @@ | ||
| 75 | * |
|
| 76 | * @param Segment $options |
|
| 77 | */ |
|
| 78 | protected function loadOptionalSegmentInformation($options) |
|
| 79 | { |
|
| 80 | if (!empty($options->operatingCompany)) { |
|
| 81 | $this->segmentInformation->companyDetails->operatingCompany = $options->operatingCompany; |
|
| 82 | } |
|
| 83 | ||
| 84 | if ($options->arrivalDate instanceof \DateTime) { |
|
| 85 | $this->segmentInformation->flightDate->setArrivalDate($options->arrivalDate); |
|
| 86 | } |
|
| 87 | ||
| 88 | if (!empty($options->groupNumber)) { |
|
| 89 | $this->segmentInformation->flightTypeDetails = new FlightTypeDetails($options->groupNumber); |
|
| 90 | } |
|
| 91 | ||
| 92 | $this->loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * @param string|null $airplaneCode |
|
| @@ 70-85 (lines=16) @@ | ||
| 67 | * |
|
| 68 | * @param FlightInfo $options |
|
| 69 | */ |
|
| 70 | protected function loadOptionalSegmentInformation($options) |
|
| 71 | { |
|
| 72 | if (! empty($options->operatingCompany)) { |
|
| 73 | $this->flightDetails->companyDetails->operatingCompany = $options->operatingCompany; |
|
| 74 | } |
|
| 75 | ||
| 76 | if ($options->arrivalDate instanceof \DateTime) { |
|
| 77 | $this->flightDetails->flightDate->setArrivalDate($options->arrivalDate); |
|
| 78 | } |
|
| 79 | ||
| 80 | if (! empty($options->groupNumber)) { |
|
| 81 | $this->flightDetails->flightTypeDetails = new FlightTypeDetails($options->groupNumber); |
|
| 82 | } |
|
| 83 | ||
| 84 | SegmentGroup::loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); |
|
| 85 | } |
|
| 86 | } |
|
| 87 | ||