Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ThemeProvider.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $themeList;
20 
24  protected $themeFactory;
25 
29  private $themes;
30 
37  public function __construct(
38  ListInterface $themeList,
40  ) {
41  $this->themeList = $themeList;
42  $this->themeFactory = $themeFactory;
43  }
44 
48  public function getThemeByFullPath($fullPath)
49  {
50  if (!isset($this->themes[$fullPath])) {
51  $this->themes[$fullPath] = $this->themeList->getThemeByFullPath($fullPath);
52  }
53  return $this->themes[$fullPath];
54  }
55 
60  public function getThemeCustomizations(
61  $area = \Magento\Framework\App\Area::AREA_FRONTEND,
62  $type = \Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL
63  ) {
64  return [];
65  }
66 
70  public function getThemeById($themeId)
71  {
72  return $this->themeFactory->getTheme($themeId);
73  }
74 }
getThemeCustomizations( $area=\Magento\Framework\App\Area::AREA_FRONTEND, $type=\Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL)
$type
Definition: item.phtml:13
$themeList
Definition: config_data.php:15
__construct(ListInterface $themeList, ThemeFactory $themeFactory)