Skip to content

Commit

Permalink
add Fare Misc Information to Pnr_AddMultiElements
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Cooper committed May 12, 2020
1 parent 511567a commit ff9079b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ protected function loadElement($element, $elementType)
FreetextDetail::TYPE_RECEIVE_FROM
);
break;
case 'FareMiscellaneousInformation':
/** @var Element\FareMiscellaneousInformation $element */
$this->fareElement = new FareElement($element->indicator,$element->passengerType,$element->freeText,$element->officeId);
break;
default:
throw new InvalidArgumentException('Element type '.$elementType.' is not supported');
}
Expand Down Expand Up @@ -320,6 +324,7 @@ protected function makeSegmentNameForRequestElement($elementType, $element)
'TourCode' => ElementManagementData::SEGNAME_TOUR_CODE,
'ManualIssuedTicket' => ElementManagementData::SEGNAME_MANUAL_DOCUMENT_REGISTRATION_WITH_ET_NUMBER,
'ScheduleChange' => ElementManagementData::SEGNAME_RECEIVE_FROM,
'FareMiscellaneousInformation' => null, // Special case - the type is a parameter.
];

if (array_key_exists($elementType, $sourceArray)) {
Expand All @@ -329,6 +334,11 @@ protected function makeSegmentNameForRequestElement($elementType, $element)
/** @var Element\Address $element */
$elementName = $element->type;
}

if ($elementType === 'FareMiscellaneousInformation') {
/** @var Element\FareMiscellaneousInformation $element */
$elementName = $element->type;
}
}

return $elementName;
Expand Down

0 comments on commit ff9079b

Please sign in to comment.