Esempio n. 1
0
 /**
  * @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();
 }
Esempio n. 2
0
 /**
  * Validate tax class can be deleted
  *
  * @return $this
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function beforeDelete()
 {
     $this->checkClassCanBeDeleted();
     return parent::beforeDelete();
 }
Esempio n. 3
0
 /**
  * Protect delete from non admin area
  *
  * @return $this
  */
 public function beforeDelete()
 {
     $this->_configDataResource->clearScopeData(ScopeInterface::SCOPE_STORES, $this->getId());
     return parent::beforeDelete();
 }
Esempio n. 4
0
 /**
  * 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();
 }