Sonata\ProductBundle\Entity\ProductCategoryManager::removeCategoryFromProduct PHP Метод

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

public removeCategoryFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CategoryInterface $category )
$product Sonata\Component\Product\ProductInterface
$category Sonata\ClassificationBundle\Model\CategoryInterface
    public function removeCategoryFromProduct(ProductInterface $product, CategoryInterface $category)
    {
        if (!($productCategory = $this->findOneBy(array('category' => $category, 'product' => $product)))) {
            return;
        }
        $product->removeProductCategory($productCategory);
        $this->delete($productCategory);
    }