21 private $converterUtils;
28 $this->converterUtils = $converterUtils;
36 if ($node->nodeType !== XML_ELEMENT_NODE) {
49 private function toArray(\DOMNode $node)
54 if ($this->hasChildElements($node)) {
57 foreach ($node->childNodes as $childNode) {
58 if ($childNode->nodeType === XML_ELEMENT_NODE) {
59 $result[
'item'][$this->converterUtils->getComponentName($childNode)] = $this->
toArray($childNode);
63 if ($node->nodeType == XML_ELEMENT_NODE) {
68 if ($node->hasAttributes()) {
93 private function hasChildElements(\DOMNode $node)
95 if ($node->hasChildNodes()) {
96 foreach ($node->childNodes as $childNode) {
97 if ($childNode->nodeType == XML_ELEMENT_NODE) {
convert(\DOMNode $node, array $data=[])
__construct(ConverterUtils $converterUtils)