UncacheableDependencyTrait.php in Drupal 10
Same filename and directory in other branches
Namespace
Drupal\Core\CacheFile
core/lib/Drupal/Core/Cache/UncacheableDependencyTrait.phpView 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
Name | Description |
---|---|
UncacheableDependencyTrait | Trait to implement CacheableDependencyInterface for uncacheable objects. |