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  $output = [];
22  $formats = $source->getElementsByTagName('format');
24  foreach ($formats as $formatConfig) {
25  $formatCode = $formatConfig->attributes->getNamedItem('code')->nodeValue;
26  $output[$formatCode] = [];
27  for ($attributeIndex = 0; $attributeIndex < $formatConfig->attributes->length; $attributeIndex++) {
28  $output[$formatCode][$formatConfig->attributes->item(
29  $attributeIndex
30  )->nodeName] = $formatConfig->attributes->item(
31  $attributeIndex
32  )->nodeValue;
33  }
34  }
35  return $output;
36  }
37 }
$source
Definition: source.php:23