Skip to content

Commit

Permalink
Теперь при обновлении файла изображения кеш сбрасывается
Browse files Browse the repository at this point in the history
  • Loading branch information
S.E.M committed Jun 29, 2017
1 parent 588ef43 commit 4e1cf45
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions models/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4e1cf45

Please sign in to comment.