DiscussionModel::getCountForCategory PHP Method

getCountForCategory() public method

Get the count of discussions for an individual category.
public getCountForCategory ( integer | array $categoryID ) : integer
$categoryID integer | array The category to get the count of or an array of category IDs to get the count of.
return integer Returns the count of discussions.
    public function getCountForCategory($categoryID)
    {
        $count = 0;
        foreach ((array) $categoryID as $id) {
            $category = CategoryModel::categories((int) $id);
            $count += (int) val('CountDiscussions', $category, 0);
        }
        return $count;
    }