class RequestStackCacheContextBase

Same name in other branches
  1. 9 core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase
  2. 8.9.x core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase
  3. 10 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

Title Sort descending Modifiers Object type Summary
RequestStackCacheContextBase::$requestStack protected property The request stack.
RequestStackCacheContextBase::__construct public function Constructs a new RequestStackCacheContextBase class.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.