Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Dump.php
Go to the documentation of this file.
1 <?php
7 
12 
23 class Dump
24 {
28  private $themeList;
29 
33  private $arrayManager;
34 
39  public function __construct(
40  ListInterface $themeList,
41  ArrayManager $arrayManager
42  ) {
43  $this->themeList = $themeList;
44  $this->arrayManager = $arrayManager;
45  }
46 
56  public function afterGet(DumpConfigSourceAggregated $subject, $result)
57  {
58  foreach ($result as $scope => &$item) {
59  if ($scope === \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT) {
60  $item = $this->changeThemeIdToFullPath($item);
61  } else {
62  foreach ($item as &$scopeItems) {
63  $scopeItems = $this->changeThemeIdToFullPath($scopeItems);
64  }
65  }
66  }
67 
68  return $result;
69  }
70 
78  private function changeThemeIdToFullPath($configItems)
79  {
80  $theme = null;
81  if ($this->arrayManager->exists(DesignInterface::XML_PATH_THEME_ID, $configItems)) {
82  $themeIdentifier = $this->arrayManager->get(DesignInterface::XML_PATH_THEME_ID, $configItems);
83  if (is_numeric($themeIdentifier)) {
84  $theme = $this->themeList->getItemById($themeIdentifier);
85  }
86 
87  if ($theme && $theme->getFullPath()) {
88  return $this->arrayManager->set(
89  DesignInterface::XML_PATH_THEME_ID,
90  $configItems,
91  $theme->getFullPath()
92  );
93  }
94  }
95 
96  return $configItems;
97  }
98 }
__construct(ListInterface $themeList, ArrayManager $arrayManager)
Definition: Dump.php:39
$themeList
Definition: config_data.php:15
$theme
afterGet(DumpConfigSourceAggregated $subject, $result)
Definition: Dump.php:56