Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigSourceAggregated.php
Go to the documentation of this file.
1 <?php
9 
11 {
15  private $sources;
16 
22  public function __construct(array $sources = [])
23  {
24  $this->sources = $sources;
25  }
26 
33  public function get($path = '')
34  {
35  $this->sortSources();
36  $data = [];
37  foreach ($this->sources as $sourceConfig) {
39  $source = $sourceConfig['source'];
40  $configData = $source->get($path);
41  if (!is_array($configData)) {
43  } elseif (!empty($configData)) {
44  $data = array_replace_recursive(is_array($data) ? $data : [], $configData);
45  }
46  }
47  return $data;
48  }
49 
55  private function sortSources()
56  {
57  uasort($this->sources, function ($firstItem, $secondItem) {
58  return $firstItem['sortOrder'] > $secondItem['sortOrder'];
59  });
60  }
61 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$source
Definition: source.php:23