configFactory = $configFactory; $this->fileCollector = $fileCollector; $this->themeCollection = $themeCollection; $this->themeCollection->setItemObjectClass(\Magento\Theme\Model\Theme\Data::class); } /** * @inheritdoc */ public function getPageLayoutsConfig() { return $this->configFactory->create(['configFiles' => $this->getConfigFiles()]); } /** * Retrieve configuration files. * * @return array */ protected function getConfigFiles() { if (!$this->configFiles) { $configFiles = []; foreach ($this->themeCollection->loadRegisteredThemes() as $theme) { $configFiles[] = $this->fileCollector->getFilesContent($theme, 'layouts.xml'); } $this->configFiles = array_merge(...$configFiles); } return $this->configFiles; } }