Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Converter.php
Go to the documentation of this file.
1 <?php
9 
11 {
18  public function convert($source)
19  {
20  $result = [];
22  foreach ($source->documentElement->childNodes as $groupNode) {
23  if ($groupNode->nodeType != XML_ELEMENT_NODE) {
24  continue;
25  }
26  $groupName = $groupNode->attributes->getNamedItem('name')->nodeValue;
28  foreach ($groupNode->childNodes as $groupAttributeNode) {
29  if ($groupAttributeNode->nodeType != XML_ELEMENT_NODE) {
30  continue;
31  }
32  $groupAttributeName = $groupAttributeNode->attributes->getNamedItem('name')->nodeValue;
33  $result[$groupName][] = $groupAttributeName;
34  }
35  }
36  return $result;
37  }
38 }
$source
Definition: source.php:23