12 use Magento\Theme\Model\ResourceModel\ThemeFactory;
26 private $deploymentConfig;
33 private $themeFactory;
40 private $dataObjectFactory;
56 ThemeFactory $themeFactory,
57 DataObjectFactory $dataObjectFactory
60 $this->themeFactory = $themeFactory;
61 $this->dataObjectFactory = $dataObjectFactory;
87 if (!$this->deploymentConfig->isDbAvailable()) {
92 $rawThemes = $this->fetchThemes();
95 foreach ($rawThemes as $themeRow) {
96 unset($themeRow[
'theme_id'], $themeRow[
'preview_image']);
97 $themePath = $themeRow[
'area'] .
'/' . $themeRow[
'theme_path'];
98 $themes[$themePath] = $themeRow;
100 if (isset($rawThemes[$themeRow[
'parent_id']][
'code'])) {
101 $themes[$themePath][
'parent_id'] = $rawThemes[$themeRow[
'parent_id']][
'code'];
105 $this->data = $this->dataObjectFactory->create($themes);
108 return $this->data->getData(
$path) ?: [];
116 private function fetchThemes()
119 $theme = $this->themeFactory->create();
121 ->from(
$theme->getMainTable())
__construct(DeploymentConfig $deploymentConfig, ThemeFactory $themeFactory, DataObjectFactory $dataObjectFactory)