/** * {@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); } }
/** * {@inheritdoc} */ public function delete(\Magento\Catalog\Api\Data\CategoryInterface $category) { try { $categoryId = $category->getId(); $this->categoryResource->delete($category); } catch (\Exception $e) { throw new StateException(__('Cannot delete category with id %1', $category->getId()), $e); } unset($this->instances[$categoryId]); return true; }