PHP Интерфейс Sonata\Component\Product\ProductCategoryManagerInterface

Наследование: extends Sonata\CoreBundle\Model\ManagerInterface
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

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

Adds a Category to 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?

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

Gets the category tree.
public getCategoryTree ( ) : Sonata\ClassificationBundle\Model\CategoryInterface[]
Результат Sonata\ClassificationBundle\Model\CategoryInterface[]

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

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

Removes a Category from a Product.
public removeCategoryFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category )
$product Sonata\Component\Product\ProductInterface
$category Sonata\ClassificationBundle\Model\CategoryInterface