Method | Description | |
---|---|---|
addCategoryToProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category, boolean $main = false ) | Adds a Category to a Product. | |
getCategoryTree ( ) : Sonata\ClassificationBundle\Model\CategoryInterface[] | Gets the category tree. | |
getProductCount ( Sonata\ClassificationBundle\Model\CategoryInterface $category, $limit = 1000 ) : integer | Returns the number of products in $category (maxed by $limit). | |
removeCategoryFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category ) | Removes a Category from a Product. |
public addCategoryToProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category, boolean $main = false ) | ||
$product | Sonata\Component\Product\ProductInterface | A Product entity |
$category | Sonata\ClassificationBundle\Model\CategoryInterface | A Category entity |
$main | boolean | Add as the main category? |
public getCategoryTree ( ) : Sonata\ClassificationBundle\Model\CategoryInterface[] | ||
return | Sonata\ClassificationBundle\Model\CategoryInterface[] |
public getProductCount ( Sonata\ClassificationBundle\Model\CategoryInterface $category, $limit = 1000 ) : integer | ||
$category | Sonata\ClassificationBundle\Model\CategoryInterface | |
return | integer |
public removeCategoryFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category ) | ||
$product | Sonata\Component\Product\ProductInterface | |
$category | Sonata\ClassificationBundle\Model\CategoryInterface |