Skip to content
Snippets Groups Projects
Commit a916311f authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

Merge branch 'task_CleanupGetCountOfLastUpdatedOrHighlightedNewsByCategory' into 'master'

[TASK] Remove the recalling of the indexAction, because it is not needed...

See merge request !34
parents 2f6f7f07 3d878343
No related branches found
No related tags found
1 merge request!34[TASK] Remove the recalling of the indexAction, because it is not needed...
......@@ -103,18 +103,6 @@ class LatestController extends AbstractController {
}
}
// Redo this function, until $newsMetaData gets the $limit. Needed because of languagevisibility.
if (count($newsMetaData) < $limit) {
$offset += $limit;
$maxCount = $this->newsRepository->getCountOfLastUpdatedOrHighlightedNewsByCategories(
FALSE, $categoryUids, TRUE, $sortBy, $tagUids, $startTime, $endTime
);
if ($offset < $maxCount) {
$this->indexAction($newsMetaData, $offset);
return;
}
}
$this->view->assign('newsMetaData', $newsMetaData);
}
......
......@@ -239,30 +239,6 @@ class NewsRepository extends AbstractRepository {
)->execute();
}
/**
* Returns the count of all possible last news.
*
* @param bool $onlyHighlighted
* @param array $categoryIds NULL, if the category filter isn't applied, otherwise an array with the categories uid.
* @param bool $hideNeverHighlightedNews
* @param string $sortBy date or positionInTree
* @param array $tagIds NULL, if the tag filter isn't applied, otherwise an array with the tag uids.
* @param int $startTime unix timestamp of the lower limit of the news results date
* @param int $endTime unix timestamp of the upper limit of the news results date
* @return int
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/
public function getCountOfLastUpdatedOrHighlightedNewsByCategories(
$onlyHighlighted = FALSE, array $categoryIds = NULL, $hideNeverHighlightedNews = FALSE, $sortBy = 'date',
array $tagIds = NULL, $startTime = 0, $endTime = 0
): int {
return $this->getCount(
$this->getQueryForLastUpdatedOrHighlightedNewsByCategories(
0, $onlyHighlighted, $categoryIds, 0, $hideNeverHighlightedNews, $sortBy, $tagIds, $startTime, $endTime
)
);
}
/**
* Returns the query object of the LastUpdatedOrHighlightedNewsByCategories.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment