Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

UncacheableDependencyTrait.php

Namespace

Drupal\Core\Cache

File

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.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal