function RefinableCacheableDependencyTrait::addCacheTags

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheTags()
  2. 8.9.x core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheTags()
  3. 10 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheTags()
3 calls to RefinableCacheableDependencyTrait::addCacheTags()
NodeSearch::__construct in core/modules/node/src/Plugin/Search/NodeSearch.php
Constructs a \Drupal\node\Plugin\Search\NodeSearch object.
RefinableCacheableDependencyTrait::addCacheableDependency in core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php
UserSearch::__construct in core/modules/user/src/Plugin/Search/UserSearch.php
Creates a UserSearch object.

File

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

Class

RefinableCacheableDependencyTrait
Trait for <a href="/api/drupal/core%21lib%21Drupal%21Core%21Cache%21RefinableCacheableDependencyInterface.php/interface/RefinableCacheableDependencyInterface/11.x" title="Allows to add cacheability metadata to an object for the current runtime." class="local">\Drupal\Core\Cache\RefinableCacheableDependencyInterface</a>.

Namespace

Drupal\Core\Cache

Code

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

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