Exemplo n.º 1
0
 /**
  * @param int $categoryId
  * @param array $settings
  * @return array
  */
 private function fetchNews($categoryId, array $settings)
 {
     if (!empty($categoryId)) {
         $news = $this->newsRepository->getAllByCategoryId((int) $categoryId, $this->date->getCurrentDateTime(), $settings['sidebar']);
     } else {
         $news = $this->newsRepository->getAll($this->date->getCurrentDateTime(), $settings['sidebar']);
     }
     return $news;
 }
Exemplo n.º 2
0
 /**
  * @param int $categoryId
  * @param string $time
  *
  * @return array
  */
 private function fetchNews($categoryId, $time)
 {
     if (!empty($categoryId)) {
         $news = $this->newsRepository->getAllByCategoryId($categoryId, $time, $this->pagination->getResultsStartOffset(), $this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME));
     } else {
         $news = $this->newsRepository->getAll($time, $this->pagination->getResultsStartOffset(), $this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME));
     }
     return $news;
 }