Sonata\ProductBundle\Entity\ProductCollectionManager::removeCollectionFromProduct PHP Method

removeCollectionFromProduct() public method

public removeCollectionFromProduct ( Sonata\Component\Product\ProductInterface $product, Sonata\ClassificationBundle\Model\CollectionInterface $collection )
$product Sonata\Component\Product\ProductInterface
$collection Sonata\ClassificationBundle\Model\CollectionInterface
    public function removeCollectionFromProduct(ProductInterface $product, CollectionInterface $collection)
    {
        if (!($productCollection = $this->findOneBy(array('collection' => $collection, 'product' => $product)))) {
            return;
        }
        $product->removeProductCollection($productCollection);
        $this->delete($productCollection);
    }