You are here

trait UnchangingCacheableDependencyTrait in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php \Drupal\Core\Cache\UnchangingCacheableDependencyTrait
  2. 10 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