/** * @return $this */ public function beforeDelete() { $this->_configDataResource->clearScopeData(\Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES, $this->getId()); $this->_configDataResource->clearScopeData(\Magento\Store\Model\ScopeInterface::SCOPE_STORES, $this->getStoreIds()); return parent::beforeDelete(); }
/** * Validate tax class can be deleted * * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function beforeDelete() { $this->checkClassCanBeDeleted(); return parent::beforeDelete(); }
/** * Protect delete from non admin area * * @return $this */ public function beforeDelete() { $this->_configDataResource->clearScopeData(ScopeInterface::SCOPE_STORES, $this->getId()); return parent::beforeDelete(); }
/** * Processing object before delete data * * @return \Magento\Tax\Model\Calculation\Rate * @throws \Magento\Framework\Exception\LocalizedException */ public function beforeDelete() { if ($this->_isInRule()) { throw new CouldNotDeleteException(__('The tax rate cannot be removed. It exists in a tax rule.')); } return parent::beforeDelete(); }