trait UnchangingCacheableDependencyTrait

Same name in other branches
  1. 9 core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php \Drupal\Core\Cache\UnchangingCacheableDependencyTrait
  2. 10 core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php \Drupal\Core\Cache\UnchangingCacheableDependencyTrait
  3. 11.x core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php \Drupal\Core\Cache\UnchangingCacheableDependencyTrait

Trait to implement CacheableDependencyInterface for unchanging objects.

Hierarchy

See also

\Drupal\Core\Cache\CacheableDependencyInterface

4 files declare their use of UnchangingCacheableDependencyTrait
BaseFieldDefinition.php in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
FieldDefinition.php in core/lib/Drupal/Core/Field/FieldDefinition.php
FormattedDateDiff.php in core/lib/Drupal/Core/Datetime/FormattedDateDiff.php
HelpSectionPluginBase.php in core/modules/help/src/Plugin/HelpSection/HelpSectionPluginBase.php

File

core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php, line 10

Namespace

Drupal\Core\Cache
View source
trait UnchangingCacheableDependencyTrait {
    
    /**
     * {@inheritdoc}
     */
    public function getCacheContexts() {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCacheTags() {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCacheMaxAge() {
        return Cache::PERMANENT;
    }

}

Members


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