aboutsummaryrefslogtreecommitdiffstats
path: root/core/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/functions.php')
-rw-r--r--core/functions.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/functions.php b/core/functions.php
index 547f84a..97ff802 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -29,7 +29,6 @@ function createPaginationTemplate($current, $last, string $location): Template {
#===============================================================================
function generateCategoryItemTemplate(Category $Category, bool $is_root = FALSE): Template {
$CategoryRepository = Application::getRepository('Category');
- $PostRepository = Application::getRepository('Post');
foreach($CategoryRepository->findWithParents($Category->getID()) as $Category) {
$category_data = generateItemTemplateData($Category);
@@ -41,8 +40,8 @@ function generateCategoryItemTemplate(Category $Category, bool $is_root = FALSE)
$Template->set('CATEGORY', $category_data ?? []);
$Template->set('CATEGORIES', $category_list ?? []);
$Template->set('COUNT', [
- 'POST' => $PostRepository->getCountByCategory($Category),
- 'CHILDREN' => $CategoryRepository->getChildrenCount($Category)
+ 'POST' => $CategoryRepository->getNumberOfPosts($Category),
+ 'CHILDREN' => $CategoryRepository->getNumberOfChildren($Category)
]);
return $Template;