public function testUpdateStoredData() { $this->model->setData(['id' => 1000, 'name' => 'Test Name']); $this->assertEmpty($this->model->getStoredData()); $this->model->afterLoad(); $this->assertEquals($this->model->getData(), $this->model->getStoredData()); $this->model->setData('value', 'Test Value'); $this->model->afterSave(); $this->assertEquals($this->model->getData(), $this->model->getStoredData()); $this->model->afterDelete(); $this->assertEmpty($this->model->getStoredData()); }
/** * Rewrite in order to clear configuration cache * * @return $this */ public function afterDelete() { parent::afterDelete(); $this->_configCacheType->clean(); return $this; }
/** * Rewrite in order to clear configuration cache * * @return $this */ public function afterDelete() { $this->_storeManager->clearWebsiteCache($this->getId()); parent::afterDelete(); return $this; }
/** * Update all relations after deleting theme * * @return $this */ public function afterDelete() { $stagingVersion = $this->getStagingVersion(); if ($stagingVersion) { $stagingVersion->delete(); } $this->getCollection()->updateChildRelations($this); return parent::afterDelete(); }
/** * {@inheritdoc} * * {@inheritdoc}. In addition, it sets status 'invalidate' for config caches * * @return $this */ public function afterDelete() { $this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER); return parent::afterDelete(); }