26 private $converterUtils;
34 $this->converter = $converter;
35 $this->converterUtils = $converterUtils;
43 if ($node->nodeType !== XML_ELEMENT_NODE) {
47 return $this->toArray($node);
56 private function toArray(\DOMNode $node)
59 $urlResult = $this->converter->convert($node, [
'type' =>
'url']);
60 return $urlResult ?: [];
66 if ($this->hasChildElements($node)) {
69 if ($node->nodeType == XML_ELEMENT_NODE) {
74 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) {
111 private function processChildNodes(\DOMNode $node)
115 foreach ($node->childNodes as $childNode) {
116 if ($childNode->nodeType === XML_ELEMENT_NODE) {
117 $result[
'item'][$this->converterUtils->getComponentName($childNode)] = $this->toArray($childNode);
__construct(ConverterInterface $converter, ConverterUtils $converterUtils)
convert(\DOMNode $node, array $data=[])