You are here

public static function RenderCache::create in RESTful 7.2

Factory function to create a new RenderCacheInterface object.

Parameters

ArrayCollection $cache_fragments: The tags collection.

\DrupalCacheInterface $cache_object: The cache backend to use.

Return value

RenderCacheInterface The cache controller.

Overrides RenderCacheInterface::create

3 calls to RenderCache::create()
Formatter::createCacheController in src/Plugin/formatter/Formatter.php
Gets a cache controller based on the data to be rendered.
RestfulRenderCacheTestCase::testRenderCache in tests/RestfulRenderCacheTestCase.test
Test Render Cache.
RestfulVariableTestCase::testRenderCache in tests/RestfulVariableTestCase.test
Test the render cache.

File

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

Class

RenderCache
Class RenderCache.

Namespace

Drupal\restful\RenderCache

Code

public static function create(ArrayCollection $cache_fragments, \DrupalCacheInterface $cache_object) {

  /* @var CacheFragmentController $controller */
  $controller = entity_get_controller('cache_fragment');
  return new static($cache_fragments, $controller
    ->generateCacheHash($cache_fragments), $cache_object);
}