1 view.inc view::revert($clear = TRUE)

Revert the view based on its module-provided default version (if any).

File

core/modules/views/includes/view.inc, line 1847
Provides the view object type and associated methods.

Class

view

Code

function revert($clear = TRUE) {
  config('views.view.' . $this->name)->delete();
  config_install_default_config($this->module, 'views.view.' . $this->name);
  cache('views')->deletePrefix('views_query:' . $this->name);

  if ($clear) {
    // Clear caches.
    views_invalidate_cache();
  }
}