You are here

public function RenderCache::__construct in RESTful 7.2

Create an object of type RenderCache.

Parameters

ArrayCollection $cache_fragments: The cache fragments.

string $hash: The hash for the cache object.

\DrupalCacheInterface $cache_object: The cache backend to use with this object.

File

src/RenderCache/RenderCache.php, line 56
Contains \Drupal\restful\RenderCache\RenderCache.

Class

RenderCache
Class RenderCache.

Namespace

Drupal\restful\RenderCache

Code

public function __construct(ArrayCollection $cache_fragments, $hash, \DrupalCacheInterface $cache_object) {
  $this->cacheFragments = $cache_fragments;

  /* @var CacheFragmentController $controller */
  $controller = entity_get_controller('cache_fragment');
  $this->hash = $hash ?: $controller
    ->generateCacheHash($cache_fragments);
  $this->cacheObject = $cache_object;
}