getProductCount() публичный Метод

Returns the number of products in $category (maxed by $limit).
public getProductCount ( Sonata\ClassificationBundle\Model\CategoryInterface $category, $limit = 1000 ) : integer
$category Sonata\ClassificationBundle\Model\CategoryInterface
Результат integer
Пример #1
0
 /**
  * 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 ? '+' : '');
 }