PHP Class Sonata\ProductBundle\Entity\ProductCategoryManager

Inheritance: extends Sonata\CoreBundle\Model\BaseEntityManager, implements Sonata\Component\Product\ProductCategoryManagerInterface
Show file Open project: sonata-project/ecommerce

Protected Properties

Property Type Description
$categoryManager Sonata\ClassificationBundle\Model\CategoryManagerInterface

Public Methods

Method Description
addCategoryToProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category, $main = false )
getCategoryTree ( )
getProductCount ( Sonata\ClassificationBundle\Model\CategoryInterface $category, $limit = 1000 )
removeCategoryFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category )

Protected Methods

Method Description
putInTree ( Sonata\ClassificationBundle\Model\CategoryInterface $category, array &$tree ) Finds $category place in $tree.

Method Details

addCategoryToProduct() public method

public addCategoryToProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category, $main = false )
$product Sonata\Component\Product\ProductInterface
$category Sonata\ClassificationBundle\Model\CategoryInterface

getCategoryTree() public method

public getCategoryTree ( )

getProductCount() public method

public getProductCount ( Sonata\ClassificationBundle\Model\CategoryInterface $category, $limit = 1000 )
$category Sonata\ClassificationBundle\Model\CategoryInterface

putInTree() protected method

Finds $category place in $tree.
protected putInTree ( Sonata\ClassificationBundle\Model\CategoryInterface $category, array &$tree )
$category Sonata\ClassificationBundle\Model\CategoryInterface
$tree array

removeCategoryFromProduct() public method

public removeCategoryFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category )
$product Sonata\Component\Product\ProductInterface
$category Sonata\ClassificationBundle\Model\CategoryInterface

Property Details

$categoryManager protected property

protected CategoryManagerInterface,Sonata\ClassificationBundle\Model $categoryManager
return Sonata\ClassificationBundle\Model\CategoryManagerInterface