function RenderCache::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/RenderCache.php \Drupal\Core\Render\RenderCache::__construct()
  2. 8.9.x core/lib/Drupal/Core/Render/RenderCache.php \Drupal\Core\Render\RenderCache::__construct()
  3. 11.x core/lib/Drupal/Core/Render/RenderCache.php \Drupal\Core\Render\RenderCache::__construct()

Constructs a new RenderCache object.

Parameters

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Cache\VariationCacheFactoryInterface $cache_factory: The variation cache factory.

\Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager: The cache contexts manager.

1 call to RenderCache::__construct()
PlaceholderingRenderCache::__construct in core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php
Constructs a new PlaceholderingRenderCache object.
1 method overrides RenderCache::__construct()
PlaceholderingRenderCache::__construct in core/lib/Drupal/Core/Render/PlaceholderingRenderCache.php
Constructs a new PlaceholderingRenderCache object.

File

core/lib/Drupal/Core/Render/RenderCache.php, line 48

Class

RenderCache
Wraps the caching logic for the render caching system.

Namespace

Drupal\Core\Render

Code

public function __construct(RequestStack $request_stack, $cache_factory, CacheContextsManager $cache_contexts_manager) {
    if ($cache_factory instanceof CacheFactoryInterface) {
        @trigger_error('Injecting ' . __CLASS__ . ' with the "cache_factory" service is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use "variation_cache_factory" instead. See https://www.drupal.org/node/3365546', E_USER_DEPRECATED);
        $cache_factory = \Drupal::service('variation_cache_factory');
    }
    $this->requestStack = $request_stack;
    $this->cacheFactory = $cache_factory;
    $this->cacheContextsManager = $cache_contexts_manager;
}

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