/** * @param int $id * @return array */ public function execute($id) { if ($this->articleRepository->resultExists((int) $id, $this->date->getCurrentDateTime()) === true) { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); return ['sidebar_article' => $this->articlesCache->getCache($id)]; } }
/** * @param int $id * * @return array * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ public function execute($id) { if ($this->articleRepository->resultExists($id, $this->date->getCurrentDateTime()) === true) { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); $article = $this->articlesCache->getCache($id); $this->breadcrumb->replaceAncestor($article['title'], '', true); return ['page' => array_merge($article, $this->pageBreaksHelper->splitTextIntoPages($this->view->fetchStringAsTemplate($article['text']), $this->request->getUriWithoutPages()))]; } throw new Core\Controller\Exception\ResultNotExistsException(); }