From 01d4727f939c0b9530fe5fc976b7accb9e078db1 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 20 Jul 2021 00:27:46 +0200 Subject: Rename and reorganize several "get count" methods --- core/functions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/functions.php') 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; -- cgit v1.2.3