protected $_enableRevisionsButton = false;
protected $_enableBulk = true;
+ protected $_flushCacheOnSave = true;
+
public $timestamps = true;
protected $_enableTrackNonDefaultValues = false;
protected function finishSave(array $options)
{
parent::finishSave($options);
- $this->flushCache();
+ if ($this->_flushCacheOnSave) {
+ $this->flushCache();
+ }
}
public function flushCache($tags = [])
return $saved;
}
+ public function saveWithoutFlushingCache($options = [])
+ {
+ $this->_flushCacheOnSave = false;
+ $this->save($options);
+ $this->_flushCacheOnSave = true;
+ }
+
public static function refreshComposedAttributes()
{
$all = static::all();