コード例 #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();
 }
コード例 #2
0
ファイル: ClassModel.php プロジェクト: opexsw/magento2
 /**
  * Validate tax class can be deleted
  *
  * @return $this
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function beforeDelete()
 {
     $this->checkClassCanBeDeleted();
     return parent::beforeDelete();
 }
コード例 #3
0
ファイル: Store.php プロジェクト: mrbadao/magento-ce
 /**
  * Protect delete from non admin area
  *
  * @return $this
  */
 public function beforeDelete()
 {
     $this->_configDataResource->clearScopeData(ScopeInterface::SCOPE_STORES, $this->getId());
     return parent::beforeDelete();
 }
コード例 #4
0
ファイル: Rate.php プロジェクト: kidaa30/magento2-platformsh
 /**
  * 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();
 }