You are here

UnchangingCacheableDependencyTrait.php in Drupal 8

Namespace

Drupal\Core\Cache

File

core/lib/Drupal/Core/Cache/UnchangingCacheableDependencyTrait.php
View source
<?php

namespace Drupal\Core\Cache;


/**
 * Trait to implement CacheableDependencyInterface for unchanging objects.
 *
 * @see \Drupal\Core\Cache\CacheableDependencyInterface
 */
trait UnchangingCacheableDependencyTrait {

  /**
   * {@inheritdoc}
   */
  public function getCacheContexts() {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheTags() {
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheMaxAge() {
    return Cache::PERMANENT;
  }

}

Traits

Namesort descending Description
UnchangingCacheableDependencyTrait Trait to implement CacheableDependencyInterface for unchanging objects.