Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FileProvider.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  protected $fileFactory;
14 
18  public function __construct(\Magento\Theme\Model\ResourceModel\Theme\File\CollectionFactory $fileFactory)
19  {
20  $this->fileFactory = $fileFactory;
21  }
22 
26  public function getItems(\Magento\Framework\View\Design\ThemeInterface $theme, array $filters = [])
27  {
29  $themeFiles = $this->fileFactory->create();
30  $themeFiles->addThemeFilter($theme);
31  foreach ($filters as $field => $value) {
32  $themeFiles->addFieldToFilter($field, $value);
33  }
34  $themeFiles->setDefaultOrder();
35  return $themeFiles->getItems();
36  }
37 }
__construct(\Magento\Theme\Model\ResourceModel\Theme\File\CollectionFactory $fileFactory)
$value
Definition: gender.phtml:16
$theme
$filters
Definition: uploader.phtml:11
getItems(\Magento\Framework\View\Design\ThemeInterface $theme, array $filters=[])