public function fetchSitemapUrls()
 {
     $this->addUrl('articles/index/index');
     foreach ($this->articleRepository->getAll($this->date->getCurrentDateTime()) as $result) {
         $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN, $result['id']), $this->date->format($result['updated_at'], 'Y-m-d'));
     }
 }
Exemple #2
0
 /**
  * @return array
  */
 public function execute()
 {
     $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
     $resultsPerPage = $this->resultsPerPage->getResultsPerPage(Articles\Installer\Schema::MODULE_NAME);
     $time = $this->date->getCurrentDateTime();
     $this->pagination->setResultsPerPage($resultsPerPage)->setTotalResults($this->articleRepository->countAll($time));
     $articles = $this->articleRepository->getAll($time, $this->pagination->getResultsStartOffset(), $resultsPerPage);
     return ['articles' => $articles, 'pagination' => $this->pagination->render()];
 }
Exemple #3
0
 /**
  * Gibt alle angelegten Artikel zurück
  *
  * @param integer $id
  *
  * @return array
  */
 public function articlesList($id = 0)
 {
     $articles = $this->articleRepository->getAll();
     $cArticles = count($articles);
     if ($cArticles > 0) {
         for ($i = 0; $i < $cArticles; ++$i) {
             $articles[$i]['selected'] = $this->formsHelper->selectEntry('articles', $articles[$i]['id'], $id);
         }
     }
     return $articles;
 }
Exemple #4
0
 /**
  * @param string $template
  * @return array
  */
 public function execute($template = '')
 {
     $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
     $this->setTemplate($template);
     return ['sidebar_articles' => $this->articleRepository->getAll($this->date->getCurrentDateTime(), 5)];
 }