You are here

public function RenderCacheBackendAdapter::get in Render cache 7.2

Gets a cache entry based on the given cache info.

Parameters

array $cache_info: The cache info structure.

Return value

array The cached render array, which can be empty.

Overrides RenderCacheBackendAdapterInterface::get

File

src/Cache/RenderCacheBackendAdapter.php, line 51
Contains \Drupal\render_cache\Cache\RenderCacheBackendAdapter

Class

RenderCacheBackendAdapter
Defines the render_cache.cache service.

Namespace

Drupal\render_cache\Cache

Code

public function get(array $cache_info) {
  $id = 42;
  $cache_info_map = array(
    $id => $cache_info,
  );
  $build = $this
    ->getMultiple($cache_info_map);
  if (!empty($build[$id])) {
    return $build[$id];
  }
  return array();
}