/** * @param int $categoryId * @param array $settings * @return array */ private function fetchFiles($categoryId, array $settings) { if (!empty($categoryId)) { $files = $this->filesRepository->getAllByCategoryId((int) $categoryId, $this->date->getCurrentDateTime(), $settings['sidebar']); } else { $files = $this->filesRepository->getAll($this->date->getCurrentDateTime(), $settings['sidebar']); } return $files; }
/** * @param int $cat * * @return array * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ public function execute($cat) { if ($this->categoryRepository->resultExists($cat) === true) { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); $category = $this->categoryRepository->getOneById($cat); $this->breadcrumb->append($this->translator->t('files', 'files'), 'files')->append($category['title']); $settings = $this->config->getSettings(FilesModule\Installer\Schema::MODULE_NAME); return ['dateformat' => $settings['dateformat'], 'files' => $this->filesRepository->getAllByCategoryId($cat, $this->date->getCurrentDateTime())]; } throw new Core\Controller\Exception\ResultNotExistsException(); }