You are here

public function RefinableCacheableDependencyTrait::addCacheTags in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheTags()
  2. 9 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheTags()

File

core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php, line 41

Class

RefinableCacheableDependencyTrait
Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface.

Namespace

Drupal\Core\Cache

Code

public function addCacheTags(array $cache_tags) {
  if ($cache_tags) {
    $this->cacheTags = Cache::mergeTags($this->cacheTags, $cache_tags);
  }
  return $this;
}