public function getCountForCategory($categoryID) { $count = 0; foreach ((array) $categoryID as $id) { $category = CategoryModel::categories((int) $id); $count += (int) val('CountDiscussions', $category, 0); } return $count; }