public function search($pattern, $path = null) { $result = []; foreach ($this->modulesList->getNames() as $moduleName) { $path = $this->getModuleDir('', $moduleName); $files = $this->modulesDirectory->search($pattern, $path); $result = array_merge($result, $files); } return $result; }
/** * Fill collection with theme model loaded from filesystem * * @param bool $printQuery * @param bool $logQuery * @return $this * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function loadData($printQuery = false, $logQuery = false) { if ($this->isLoaded()) { return $this; } $pathsToThemeConfig = []; foreach ($this->getTargetPatterns() as $directoryPath) { $themeConfigs = $this->_directory->search($directoryPath); foreach ($themeConfigs as &$relPathToTheme) { $relPathToTheme = $this->_directory->getAbsolutePath($relPathToTheme); } $pathsToThemeConfig = array_merge($pathsToThemeConfig, $themeConfigs); } $this->_loadFromFilesystem($pathsToThemeConfig)->clearTargetPatterns()->_updateRelations()->_renderFilters()->_clearFilters(); return $this; }