Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Aggregated.php
Go to the documentation of this file.
1 <?php
8 
12 
17 {
23  protected $fileListFactory;
24 
30  protected $baseFiles;
31 
37  protected $themeFiles;
38 
44  protected $overrideBaseFiles;
45 
52 
62  public function __construct(
68  ) {
69  $this->fileListFactory = $fileListFactory;
70  $this->baseFiles = $baseFiles;
71  $this->themeFiles = $themeFiles;
72  $this->overrideBaseFiles = $overrideBaseFiles;
73  $this->overrideThemeFiles = $overrideThemeFiles;
74  }
75 
85  public function getFiles(ThemeInterface $theme, $filePath)
86  {
87  $list = $this->fileListFactory->create();
88  $list->add($this->baseFiles->getFiles($theme, $filePath));
89 
90  foreach ($theme->getInheritedThemes() as $currentTheme) {
91  $list->add($this->themeFiles->getFiles($currentTheme, $filePath));
92  $list->replace($this->overrideBaseFiles->getFiles($currentTheme, $filePath));
93  $list->replace($this->overrideThemeFiles->getFiles($currentTheme, $filePath));
94  }
95  return $list->getAll();
96  }
97 }
__construct(Factory $fileListFactory, CollectorInterface $baseFiles, CollectorInterface $themeFiles, CollectorInterface $overrideBaseFiles, CollectorInterface $overrideThemeFiles)
Definition: Aggregated.php:62
$theme
getFiles(ThemeInterface $theme, $filePath)
Definition: Aggregated.php:85