You are here

public function RenderCache::set in RESTful 7.2

Set the cache.

Parameters

mixed $value: The value to cache.

Overrides RenderCacheInterface::set

File

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

Class

RenderCache
Class RenderCache.

Namespace

Drupal\restful\RenderCache

Code

public function set($value) {

  /* @var CacheFragmentController $controller */
  $controller = entity_get_controller('cache_fragment');
  if (!$controller
    ->createCacheFragments($this->cacheFragments)) {
    return;
  }
  $this->cacheObject
    ->set($this
    ->generateCacheId(), $value);
}