OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\SimpleXml Class Reference

Public Member Functions

 objectToXml ($oInput, $sDocument)
 
 xmlToObject ($sXml)
 

Protected Member Functions

 _addSimpleXmlElement ($oXml, $oInput, $sPreferredKey=null)
 
 _addChildNode ($oXml, $sKey, $mElement, $sPreferredKey=null)
 
 _addNodeAttributes ($oNode, $aAttributes)
 

Detailed Description

Parses objects to XML and XML to simple XML objects.

Example object: oxStdClass Object ( [title] => TestTitle [keys] => oxStdClass Object ( [key] => Array ( [0] => testKey1 [1] => testKey2 ) ) )

would produce the following XML: <?xml version="1.0" encoding="utf-8"?> <testXml><title>TestTitle</title><keys><key>testKey1</key><key>testKey2</key></keys></testXml>

Member Function Documentation

◆ _addChildNode()

OxidEsales\EshopCommunity\Core\SimpleXml::_addChildNode (   $oXml,
  $sKey,
  $mElement,
  $sPreferredKey = null 
)
protected

Adds child node to given simple xml object.

Parameters
SimpleXMLElement$oXml
string$sKey
string | array | object$mElement
string$sPreferredKey
Returns
SimpleXMLElement

◆ _addNodeAttributes()

OxidEsales\EshopCommunity\Core\SimpleXml::_addNodeAttributes (   $oNode,
  $aAttributes 
)
protected

Adds attributes to given node.

Parameters
SimpleXMLElement$oNode
array$aAttributes
Returns
SimpleXMLElement

◆ _addSimpleXmlElement()

OxidEsales\EshopCommunity\Core\SimpleXml::_addSimpleXmlElement (   $oXml,
  $oInput,
  $sPreferredKey = null 
)
protected

Recursively adds $oInput object data to SimpleXMLElement structure

Parameters
SimpleXMLElement$oXmlXml handler
string | array | object$oInputInput object
string$sPreferredKeyKey to use instead of node's key.
Returns
SimpleXMLElement

◆ objectToXml()

OxidEsales\EshopCommunity\Core\SimpleXml::objectToXml (   $oInput,
  $sDocument 
)

Parses object structure to XML string

Parameters
object$oInputInput object
string$sDocumentDocument name.
Returns
string

◆ xmlToObject()

OxidEsales\EshopCommunity\Core\SimpleXml::xmlToObject (   $sXml)

Parses XML string into object structure

Parameters
string$sXmlXML Input
Returns
SimpleXMLElement

The documentation for this class was generated from the following file: