/** * Processing object after delete data * * @return \Magento\Framework\Model\AbstractModel */ protected function _afterDelete() { $result = parent::_afterDelete(); if ($this->getScope() == 'websites') { $website = $this->storeManager->getWebsite($this->getScopeCode()); foreach ($this->_getAttributeObjects() as $attributeObject) { $attributeObject->setWebsite($website); $attributeObject->load($attributeObject->getId()); $attributeObject->setData('scope_is_required', null); $attributeObject->setData('scope_is_visible', null); $attributeObject->save(); } } return $result; }
/** * Processing object after delete data * * @return \Magento\Framework\Model\AbstractModel */ protected function _afterDelete() { $result = parent::_afterDelete(); if ($this->getScope() == \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES) { $attribute = $this->_eavConfig->getAttribute('customer_address', 'street'); $website = $this->_storeManager->getWebsite($this->getScopeCode()); $attribute->setWebsite($website); $attribute->load($attribute->getId()); $attribute->setData('scope_multiline_count', null); $attribute->save(); } return $result; }