You are here

abstract class RequestStackCacheContextBase in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase

Defines a base class for cache contexts depending only on the request stack.

Subclasses need to implement either \Drupal\Core\Cache\Context\CacheContextInterface or \Drupal\Core\Cache\Context\CalculatedCacheContextInterface.

Hierarchy

Expanded class hierarchy of RequestStackCacheContextBase

File

core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php, line 14

Namespace

Drupal\Core\Cache\Context
View source
abstract class RequestStackCacheContextBase {

  /**
   * The request stack.
   *
   * @var \Symfony\Component\HttpFoundation\RequestStack
   */
  protected $requestStack;

  /**
   * Constructs a new RequestStackCacheContextBase class.
   *
   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
   *   The request stack.
   */
  public function __construct(RequestStack $request_stack) {
    $this->requestStack = $request_stack;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RequestStackCacheContextBase::$requestStack protected property The request stack.
RequestStackCacheContextBase::__construct public function Constructs a new RequestStackCacheContextBase class.