Example #1
0
 /**
  * {@inheritdoc}
  */
 public function delete($object)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'delete');
     if (!$pluginInfo) {
         return parent::delete($object);
     } else {
         return $this->___callPlugins('delete', func_get_args(), $pluginInfo);
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function delete(\Magento\Catalog\Api\Data\ProductInterface $product)
 {
     $sku = $product->getSku();
     $productId = $product->getId();
     try {
         $this->resourceModel->delete($product);
     } catch (\Exception $e) {
         throw new \Magento\Framework\Exception\StateException(__('Unable to remove product %1', $sku));
     }
     unset($this->instances[$sku]);
     unset($this->instancesById[$productId]);
     return true;
 }