/** * Processing object after delete data * * @return \Magento\Framework\Model\AbstractModel */ public 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; }
/** * Processing object after delete data * * @return \Magento\Framework\Model\AbstractModel */ public 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; }
/** * {@inheritdoc} */ public function afterDelete() { $this->invalidateCache(true); return parent::afterDelete(); }
/** * @return void; */ public function testAfterDelete() { $this->cacheTypeListMock->expects($this->once())->method('invalidate'); $this->assertInstanceOf(get_class($this->model), $this->model->afterDelete()); }