diff --git a/models/Image.php b/models/Image.php index 04dcbe5..e340871 100644 --- a/models/Image.php +++ b/models/Image.php @@ -118,6 +118,23 @@ public function beforeDelete() } /** + * @inheritdoc + */ + public function beforeSave($insert) + { + if (parent::beforeSave($insert)) { + + if (!$insert) { + $this->clearCache(); + } + + return true; + } + + return false; + } + + /** * @inheritDoc */ protected function removeFile()