You are here

function views_cache_get in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 6.3 includes/cache.inc \views_cache_get()
  2. 6.2 includes/cache.inc \views_cache_get()
  3. 7.3 includes/cache.inc \views_cache_get()

Return data from the persistent views cache.

This is just a convenience wrapper around cache_get().

Parameters

int $cid: The cache ID of the data to retrieve.

bool $use_language: If TRUE, the data will be requested specific to the currently active language.

Return value

stdClass|bool The cache or FALSE on failure.

3 calls to views_cache_get()
DisplayPluginBase::init in lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
views_block_info in ./views.module
Implement hook_block_info().
_views_fetch_data in includes/cache.inc
Fetch Views' data from the cache.

File

includes/cache.inc, line 150
Load Views' data so that it knows what is available to build queries from.

Code

function views_cache_get($cid, $use_language = FALSE) {
  if (config('views.settings')
    ->get('skip_cache')) {
    return FALSE;
  }
  if ($use_language) {
    $cid .= ':' . language(LANGUAGE_TYPE_INTERFACE)->langcode;
  }
  return cache('views_info')
    ->get($cid);
}