PHP Class XmlSerializer, googleads-php-lib

Inheritance: extends Serializer
Datei anzeigen Open project: googleads/googleads-php-lib Class Usage Examples

Public Methods

Method Description
ConvertObjectToXml ( mixed $object, string $rootElementName, boolean $useXsiType ) : string Converts an object to an XML string. The root element name is passed in as a parameter, and each field of the object becomes a child element. Array values are represented by multiples instances of that element. Methods on the object are ignored.

Private Methods

Method Description
ConvertObjectToElement ( mixed $object, string $elementName, DOMDocument $document, boolean $useXsiType ) : DOMElement Converts an object to a DOMElement.
ConvertObjectToNodeValue ( mixed $object ) Converts a PHP value to a string for use in an XML node value.
CreateChildListForObjects ( object $object, DOMDocument $document, boolean $useXsiType ) : array Creates an array of child elements for objects.
CreateChildListForOrderedArrays ( array $orderedArray, DOMDocument $document, boolean $useXsiType ) : array Creates an array of child elements for ordered arrays.

Method Details

ConvertObjectToXml() public method

Converts an object to an XML string. The root element name is passed in as a parameter, and each field of the object becomes a child element. Array values are represented by multiples instances of that element. Methods on the object are ignored.
public ConvertObjectToXml ( mixed $object, string $rootElementName, boolean $useXsiType ) : string
$object mixed the object to serialize
$rootElementName string the name of the root element
$useXsiType boolean whether the xsi:type will be added into XML tags when available
return string the XML serialized string of the object