public getProductCount ( Sonata\ClassificationBundle\Model\CategoryInterface $category, $limit = 1000 ) : integer | ||
$category | Sonata\ClassificationBundle\Model\CategoryInterface | |
return | integer |
public function getProductCount(CategoryInterface $category, $limit = 1000);
/** * Gets the HTML associated with the category menu title * * @param CategoryInterface $category A category instance * @param int $limit A limit for calculation (fixed to 500 by default) * * @return string */ protected function getCategoryTitle(CategoryInterface $category, $limit = 500) { $count = $this->categoryManager->getProductCount($category, $limit); return sprintf("%s <span class=\"badge pull-right\">%d%s</span>", $category->getName(), $count, $count > $limit ? '+' : ''); }