function ViewExecutable::getCacheTags

Same name and namespace in other branches
  1. 9 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::getCacheTags()
  2. 8.9.x core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::getCacheTags()
  3. 11.x 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 1577

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();
}

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