src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Model.php
protected function _toXMLFragment() 
    {
        $xml = "";
        foreach ($this->_fields as $fieldName => $field) {
            $fieldValue = $field['FieldValue'];
            if (!is_null($fieldValue)) {
                $fieldType = $field['FieldType'];
                if (is_array($fieldType)) {
                    if ($this->_isComplexType($fieldType[0])) {
                        foreach ($fieldValue as $item) {
                            $xml .= "<$fieldName>";
                            $xml .= $item->_toXMLFragment();
                            $xml .= "</$fieldName>";
                        }
                    } else {
                        foreach ($fieldValue as $item) {
                            $xml .= "<$fieldName>";
                            $xml .= $this->_escapeXML($item);
                            $xml .= "</$fieldName>";
                        }
                    }
                } else {
                    if ($this->_isComplexType($fieldType)) {
                        $xml .= "<$fieldName>";
                        $xml .= $fieldValue->_toXMLFragment();
                        $xml .= "</$fieldName>";
                    } else {
                        $xml .= "<$fieldName>";
                        $xml .= $this->_escapeXML($fieldValue);
                        $xml .= "</$fieldName>";
                    }
                }
            }
        }
        return $xml;
    }
protected function _toXMLFragment() 
    {
        $xml = "";
        foreach ($this->_fields as $fieldName => $field) {
            $fieldValue = $field['FieldValue'];
            if (!is_null($fieldValue)) {
                $fieldType = $field['FieldType'];
                if (is_array($fieldType)) {
                    if ($this->_isComplexType($fieldType[0])) {
                        foreach ($fieldValue as $item) {
                            $xml .= "<$fieldName>";
                            $xml .= $item->_toXMLFragment();
                            $xml .= "</$fieldName>";
                        }
                    } else {
                        foreach ($fieldValue as $item) {
                            $xml .= "<$fieldName>";
                            $xml .= $this->_escapeXML($item);
                            $xml .= "</$fieldName>";
                        }
                    }
                } else {
                    if ($this->_isComplexType($fieldType)) {
                        $xml .= "<$fieldName>";
                        $xml .= $fieldValue->_toXMLFragment();
                        $xml .= "</$fieldName>";
                    } else {
                        $xml .= "<$fieldName>";
                        $xml .= $this->_escapeXML($fieldValue);
                        $xml .= "</$fieldName>";
                    }
                }
            }
        }
        return $xml;
    }
protected function _toXMLFragment ( ) { $ xml = "" ; foreach ( $ this -> _fields as $ fieldName => $ field ) { $ fieldValue = $ field [ 'FieldValue' ] ; if ( ! is_null ( $ fieldValue ) ) { $ fieldType = $ field [ 'FieldType' ] ; if ( is_array ( $ fieldType ) ) { if ( $ this -> _isComplexType ( $ fieldType [ 0 ] ) ) { foreach ( $ fieldValue as $ item ) { $ xml .= "<$fieldName>" ; $ xml .= $ item -> _toXMLFragment ( ) ; $ xml .= "</$fieldName>" ; } } else { foreach ( $ fieldValue as $ item ) { $ xml .= "<$fieldName>" ; $ xml .= $ this -> _escapeXML ( $ item ) ; $ xml .= "</$fieldName>" ; } } } else { if ( $ this -> _isComplexType ( $ fieldType ) ) { $ xml .= "<$fieldName>" ; $ xml .= $ fieldValue -> _toXMLFragment ( ) ; $ xml .= "</$fieldName>" ; } else { $ xml .= "<$fieldName>" ; $ xml .= $ this -> _escapeXML ( $ fieldValue ) ; $ xml .= "</$fieldName>" ; } } } } return $ xml ; }
XML fragment representation of this object
Note, name of the root determined by caller
This fragment returns inner fields representation only
@return string XML fragment for this object
XML fragment representation of this object Note name of the root determined by caller This fragment returns inner fields representation only