abstract class RequestStackCacheContextBase in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Cache/Context/RequestStackCacheContextBase.php \Drupal\Core\Cache\Context\RequestStackCacheContextBase
- 9 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
- class \Drupal\Core\Cache\Context\RequestStackCacheContextBase
Expanded class hierarchy of RequestStackCacheContextBase
File
- core/
lib/ Drupal/ Core/ Cache/ Context/ RequestStackCacheContextBase.php, line 14
Namespace
Drupal\Core\Cache\ContextView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestStackCacheContextBase:: |
protected | property | The request stack. | |
RequestStackCacheContextBase:: |
public | function | Constructs a new RequestStackCacheContextBase class. |