/** * @param string $property * @param PPXmlMessage|string $value * @param string $namespace * @return string */ private function buildProperty($property, $value, $namespace = 'ebl') { $annotations = PPUtils::propertyAnnotations($this, $property); if (!empty($annotations['namespace'])) { $namespace = $annotations['namespace']; } if (!empty($annotations['name'])) { $property = $annotations['name']; } if ($namespace === true) { $el = '<' . $property; } else { $el = '<' . $namespace . ':' . $property; } if (!is_object($value)) { $el .= '>' . PPUtils::escapeInvalidXmlCharsRegex($value); } else { if (substr($value = $value->toXMLString(), 0, 1) === '<' || $value == '') { $el .= '>' . $value; } else { $el .= ' ' . $value; } } if ($namespace === true) { return $el . '</' . $property . '>'; } else { return $el . '</' . $namespace . ':' . $property . '>'; } }
public function toXMLString() { $str = ''; $str .= parent::toXMLString(); if ($this->ExternalRememberMeID != null) { $str .= '<urn:ExternalRememberMeID>' . PPUtils::escapeInvalidXmlCharsRegex($this->ExternalRememberMeID) . '</urn:ExternalRememberMeID>'; } if ($this->ExternalRememberMeOwnerDetails != null) { $str .= '<urn:ExternalRememberMeOwnerDetails>'; $str .= $this->ExternalRememberMeOwnerDetails->toXMLString(); $str .= '</urn:ExternalRememberMeOwnerDetails>'; } return $str; }