Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function afterDelete()
 {
     $this->invalidateCache(true);
     return parent::afterDelete();
 }
Пример #4
0
 /**
  * @return void;
  */
 public function testAfterDelete()
 {
     $this->cacheTypeListMock->expects($this->once())->method('invalidate');
     $this->assertInstanceOf(get_class($this->model), $this->model->afterDelete());
 }