Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Path.php
Go to the documentation of this file.
1 <?php
11 
16 class Path extends \Magento\Config\Model\Config\Structure\AbstractMapper
17 {
24  public function map(array $data)
25  {
26  if ($this->_hasValue('config/system/sections', $data)) {
27  foreach ($data['config']['system']['sections'] as &$sectionConfig) {
28  if ($this->_hasValue('children', $sectionConfig)) {
29  foreach ($sectionConfig['children'] as &$groupConfig) {
30  $groupConfig = $this->_processConfig($groupConfig, $sectionConfig);
31  }
32  }
33  }
34  }
35  return $data;
36  }
37 
45  protected function _processConfig(array $elementConfig, array $parentConfig)
46  {
47  $parentPath = $this->_hasValue('path', $parentConfig) ? $parentConfig['path'] . '/' : '';
48  $parentPath .= $parentConfig['id'];
49  $elementConfig['path'] = $parentPath;
50 
51  if ($this->_hasValue('children', $elementConfig)) {
52  foreach ($elementConfig['children'] as &$subConfig) {
53  $subConfig = $this->_processConfig($subConfig, $elementConfig);
54  }
55  }
56 
57  return $elementConfig;
58  }
59 }
_processConfig(array $elementConfig, array $parentConfig)
Definition: Path.php:45