trait UnchangingCacheableDependencyTrait
Trait to implement CacheableDependencyInterface for unchanging objects.
Hierarchy
- trait \Drupal\Core\Cache\UnchangingCacheableDependencyTrait
 
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\CacheView source
trait UnchangingCacheableDependencyTrait {
  
  /**
   * {@inheritdoc}
   */
  public function getCacheContexts() {
    return [];
  }
  
  /**
   * {@inheritdoc}
   */
  public function getCacheTags() {
    return [];
  }
  
  /**
   * {@inheritdoc}
   */
  public function getCacheMaxAge() {
    return Cache::PERMANENT;
  }
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overrides | 
|---|---|---|---|---|
| UnchangingCacheableDependencyTrait::getCacheContexts | public | function | 1 | |
| UnchangingCacheableDependencyTrait::getCacheMaxAge | public | function | 3 | |
| UnchangingCacheableDependencyTrait::getCacheTags | public | function | 1 | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.