getCurrentPage(); $category = $this->getCategoryReadRepository()->getBySlug($slug); $topics = $this ->getTopicReadRepository() ->findByCategoryIdOrderedByLastActivity( $category['id'], $rowsPerPage, $this->getSkipRowsNumber($rowsPerPage) ); $topicsCount = $this->getTopicReadRepository()->countByCategoryId($category['id']); $this->renderView([ 'category' => $category, 'topics' => $topics, 'page' => $page, 'pages' => $this->getTotalPages($topicsCount, $rowsPerPage), ]); } private function getCategoryReadRepository(): CategoryReadRepository { return new CategoryReadRepository(); } private function getTopicReadRepository(): TopicReadRepository { return new TopicReadRepository(); } }