protected function makeSegmentNameForRequestElement($elementType, $element)
    {
        $elementName = '';

        $sourceArray = [
            'Contact' => ElementManagementData::SEGNAME_CONTACT_ELEMENT,
            'FormOfPayment' => ElementManagementData::SEGNAME_FORM_OF_PAYMENT,
            'MiscellaneousRemark' => ElementManagementData::SEGNAME_GENERAL_REMARK,
            'ReceivedFrom' => ElementManagementData::SEGNAME_RECEIVE_FROM,
            'ServiceRequest' => ElementManagementData::SEGNAME_SPECIAL_SERVICE_REQUEST,
            'Ticketing' => ElementManagementData::SEGNAME_TICKETING_ELEMENT,
            'AccountingInfo' => ElementManagementData::SEGNAME_ACCOUNTING_INFORMATION,
            'Address' => null, // Special case - the type is a parameter.
            'FrequentFlyer' => ElementManagementData::SEGNAME_SPECIAL_SERVICE_REQUEST,
            'OtherServiceInfo' => ElementManagementData::SEGNAME_OTHER_SERVICE_INFORMATION,
            'ManualCommission' => ElementManagementData::SEGNAME_COMMISSION,
            'SeatRequest' => ElementManagementData::SEGNAME_SEAT_REQUEST,
            'TourCode' => ElementManagementData::SEGNAME_TOUR_CODE,
            'ManualIssuedTicket' => ElementManagementData::SEGNAME_MANUAL_DOCUMENT_REGISTRATION_WITH_ET_NUMBER
        ];

        if (array_key_exists($elementType, $sourceArray)) {
            $elementName = $sourceArray[$elementType];

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

        return $elementName;
    }
protected function makeSegmentNameForRequestElement($elementType, $element)
    {
        $elementName = '';

        $sourceArray = [
            'Contact' => ElementManagementData::SEGNAME_CONTACT_ELEMENT,
            'FormOfPayment' => ElementManagementData::SEGNAME_FORM_OF_PAYMENT,
            'MiscellaneousRemark' => ElementManagementData::SEGNAME_GENERAL_REMARK,
            'ReceivedFrom' => ElementManagementData::SEGNAME_RECEIVE_FROM,
            'ServiceRequest' => ElementManagementData::SEGNAME_SPECIAL_SERVICE_REQUEST,
            'Ticketing' => ElementManagementData::SEGNAME_TICKETING_ELEMENT,
            'AccountingInfo' => ElementManagementData::SEGNAME_ACCOUNTING_INFORMATION,
            'Address' => null, // Special case - the type is a parameter.
            'FrequentFlyer' => ElementManagementData::SEGNAME_SPECIAL_SERVICE_REQUEST,
            'OtherServiceInfo' => ElementManagementData::SEGNAME_OTHER_SERVICE_INFORMATION,
            'ManualCommission' => ElementManagementData::SEGNAME_COMMISSION,
            'SeatRequest' => ElementManagementData::SEGNAME_SEAT_REQUEST,
            'TourCode' => ElementManagementData::SEGNAME_TOUR_CODE,
            'ManualIssuedTicket' => ElementManagementData::SEGNAME_MANUAL_DOCUMENT_REGISTRATION_WITH_ET_NUMBER
        ];

        if (array_key_exists($elementType, $sourceArray)) {
            $elementName = $sourceArray[$elementType];

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

        return $elementName;
    }
protected function makeSegmentNameForRequestElement ( $ elementType , $ element ) { $ elementName = '' ; $ sourceArray = [ 'Contact' => ElementManagementData :: SEGNAME_CONTACT_ELEMENT , 'FormOfPayment' => ElementManagementData :: SEGNAME_FORM_OF_PAYMENT , 'MiscellaneousRemark' => ElementManagementData :: SEGNAME_GENERAL_REMARK , 'ReceivedFrom' => ElementManagementData :: SEGNAME_RECEIVE_FROM , 'ServiceRequest' => ElementManagementData :: SEGNAME_SPECIAL_SERVICE_REQUEST , 'Ticketing' => ElementManagementData :: SEGNAME_TICKETING_ELEMENT , 'AccountingInfo' => ElementManagementData :: SEGNAME_ACCOUNTING_INFORMATION , 'Address' => null , // Special case - the type is a parameter. 'FrequentFlyer' => ElementManagementData :: SEGNAME_SPECIAL_SERVICE_REQUEST , 'OtherServiceInfo' => ElementManagementData :: SEGNAME_OTHER_SERVICE_INFORMATION , 'ManualCommission' => ElementManagementData :: SEGNAME_COMMISSION , 'SeatRequest' => ElementManagementData :: SEGNAME_SEAT_REQUEST , 'TourCode' => ElementManagementData :: SEGNAME_TOUR_CODE , 'ManualIssuedTicket' => ElementManagementData :: SEGNAME_MANUAL_DOCUMENT_REGISTRATION_WITH_ET_NUMBER ] ; if ( array_key_exists ( $ elementType , $ sourceArray ) ) { $ elementName = $ sourceArray [ $ elementType ] ; if ( $ elementType === 'Address' ) { /** @var Element\Address $element */ $ elementName = $ element -> type ; } } return $ elementName ; }
Create the correct element identifier for a given element

@param string $elementType
@param Element $element
@return string
Create the correct element identifier for a given element