UncacheableDependencyTrait.php
Same filename in other branches
Namespace
Drupal\Core\CacheFile
-
core/
lib/ Drupal/ Core/ Cache/ UncacheableDependencyTrait.php
View source
<?php
namespace Drupal\Core\Cache;
/**
* Trait to implement CacheableDependencyInterface for uncacheable objects.
*
* Use this for objects that are never cacheable.
*
* @see \Drupal\Core\Cache\CacheableDependencyInterface
*/
trait UncacheableDependencyTrait {
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return [];
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return [];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return 0;
}
}
Traits
Title | Deprecated | Summary |
---|---|---|
UncacheableDependencyTrait | Trait to implement CacheableDependencyInterface for uncacheable objects. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.