UnchangingCacheableDependencyTrait.php 503 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Drupal\Core\Cache;
  3. /**
  4. * Trait to implement CacheableDependencyInterface for unchanging objects.
  5. *
  6. * @see \Drupal\Core\Cache\CacheableDependencyInterface
  7. */
  8. trait UnchangingCacheableDependencyTrait {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function getCacheContexts() {
  13. return [];
  14. }
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function getCacheTags() {
  19. return [];
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function getCacheMaxAge() {
  25. return Cache::PERMANENT;
  26. }
  27. }