/** * @return array */ public function fetchFeedItems() { $items = []; $results = $this->filesRepository->getAll($this->date->getCurrentDateTime(), 10); $cResults = count($results); for ($i = 0; $i < $cResults; ++$i) { $items[] = ['title' => $results[$i]['title'], 'date' => $this->date->timestamp($results[$i]['start']), 'description' => $this->formatter->shortenEntry($results[$i]['text'], 300, 0), 'link' => $this->router->route('files/index/details/id_' . $results[$i]['id'], true)]; } return $items; }
/** * @param array $news * * @return string */ protected function addReadMoreLink(array $news) { $readMoreLink = '...<a href="' . $this->router->route('news/details/id_' . $news['id']) . '">['; $readMoreLink .= $this->translator->t('news', 'readmore') . "]</a>\n"; return $this->stringFormatter->shortenEntry($news['text'], $this->newsSettings['readmore_chars'], 50, $readMoreLink); }