public function CachePluginBase::getCacheTags in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getCacheTags()
Gets an array of cache tags for the current view.
Return value
string[] An array of cache tags based on the current view.
1 call to CachePluginBase::getCacheTags()
- CachePluginBase::cacheSet in core/modules/ views/ src/ Plugin/ views/ cache/ CachePluginBase.php 
- Save data to the cache.
File
- core/modules/ views/ src/ Plugin/ views/ cache/ CachePluginBase.php, line 228 
- Contains \Drupal\views\Plugin\views\cache\CachePluginBase.
Class
- CachePluginBase
- The base plugin to handle caching.
Namespace
Drupal\views\Plugin\views\cacheCode
public function getCacheTags() {
  $tags = $this->view->storage
    ->getCacheTags();
  // The list cache tags for the entity types listed in this view.
  $entity_information = $this->view
    ->getQuery()
    ->getEntityTableInfo();
  if (!empty($entity_information)) {
    // Add the list cache tags for each entity type used by this view.
    foreach ($entity_information as $table => $metadata) {
      $tags = Cache::mergeTags($tags, \Drupal::entityManager()
        ->getDefinition($metadata['entity_type'])
        ->getListCacheTags());
    }
  }
  $tags = Cache::mergeTags($tags, $this->view
    ->getQuery()
    ->getCacheTags());
  return $tags;
}