function Views::invalidateCache

Invalidates views data cache.

2 calls to Views::invalidateCache()
View::postDelete in core/modules/views/src/Entity/View.php
Acts on deleted entities before the delete hook is invoked.
View::postSave in core/modules/views/src/Entity/View.php
Acts on a saved entity before the insert or update hook is invoked.

File

core/modules/views/src/Views.php, line 609

Class

Views
Static service container wrapper for views.

Namespace

Drupal\views

Code

public static function invalidateCache() : void {
  \Drupal::service('cache_tags.invalidator')->invalidateTags([
    'views_data',
  ]);
  // Allow modules to respond to the Views cache being cleared.
  \Drupal::moduleHandler()->invokeAll('views_invalidate_cache');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.