Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Builder.php
Go to the documentation of this file.
1 <?php
9 
14 {
18  protected $configFactory;
19 
23  protected $fileCollector;
24 
28  protected $themeCollection;
29 
35  public function __construct(
36  \Magento\Framework\View\PageLayout\ConfigFactory $configFactory,
37  \Magento\Framework\View\PageLayout\File\Collector\Aggregated $fileCollector,
39  ) {
40  $this->configFactory = $configFactory;
41  $this->fileCollector = $fileCollector;
42  $this->themeCollection = $themeCollection;
43  $this->themeCollection->setItemObjectClass(\Magento\Theme\Model\Theme\Data::class);
44  }
45 
49  public function getPageLayoutsConfig()
50  {
51  return $this->configFactory->create(['configFiles' => $this->getConfigFiles()]);
52  }
53 
57  protected function getConfigFiles()
58  {
59  $configFiles = [];
60  foreach ($this->themeCollection->loadRegisteredThemes() as $theme) {
61  $configFiles = array_merge($configFiles, $this->fileCollector->getFilesContent($theme, 'layouts.xml'));
62  }
63 
64  return $configFiles;
65  }
66 }
__construct(\Magento\Framework\View\PageLayout\ConfigFactory $configFactory, \Magento\Framework\View\PageLayout\File\Collector\Aggregated $fileCollector, \Magento\Theme\Model\ResourceModel\Theme\Collection $themeCollection)
Definition: Builder.php:35
$theme