/** * {@inheritdoc} */ public function removeCategoryFromProduct(ProductInterface $product, CategoryInterface $category) { if (!($productCategory = $this->findOneBy(array('category' => $category, 'product' => $product)))) { return; } $product->removeProductCategory($productCategory); $this->delete($productCategory); }