aboutsummaryrefslogtreecommitdiffstats
path: root/core/functions.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-20 00:27:46 +0200
committerThomas Lange <code@nerdmind.de>2021-07-20 00:34:47 +0200
commit01d4727f939c0b9530fe5fc976b7accb9e078db1 (patch)
tree2053b57a25ef42cec5c6e79ae837e5a4d0ceb69e /core/functions.php
parentdd4b3d9ebb85c9bc8138212fd7cb207ab154f626 (diff)
downloadblog-01d4727f939c0b9530fe5fc976b7accb9e078db1.tar.gz
blog-01d4727f939c0b9530fe5fc976b7accb9e078db1.tar.xz
blog-01d4727f939c0b9530fe5fc976b7accb9e078db1.zip
Rename and reorganize several "get count" methods
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;