You are here

public function ViewExecutable::getCacheTags in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::getCacheTags()

Gets the cache tags associated with the executed view.

Note: The cache plugin controls the used tags, so you can override it, if needed.

Return value

string[] An array of cache tags.

File

core/modules/views/src/ViewExecutable.php, line 1562

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function getCacheTags() {
  $this
    ->initDisplay();

  /** @var \Drupal\views\Plugin\views\cache\CachePluginBase $cache */
  $cache = $this->display_handler
    ->getPlugin('cache');
  return $cache
    ->getCacheTags();
}