function _views_fetch_data

cis7 cache.inc _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE)
cle7 cache.inc _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE)
elmsmedia7 cache.inc _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE)
icor7 cache.inc _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE)
meedjum_blog7 cache.inc _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE)
mooc7 cache.inc _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE)

Fetch Views' data from the cache

Parameters

$move: Under certain circumstances it makes sense to not get the moved table, but the old one. One example is views_get_handler.

1 call to _views_fetch_data()
views_fetch_data in sites/all/modules/ulmus/views/views.module
Fetch Views' data from the cache

File

sites/all/modules/ulmus/views/includes/cache.inc, line 15
Load Views' data so that it knows what is available to build queries from.

Code

function _views_fetch_data($table = NULL, $move = TRUE, $reset = FALSE) {
  $cache = &drupal_static(__FUNCTION__ . '_cache');
  $recursion_protection = &drupal_static(__FUNCTION__ . '_recursion_protected');
  $fully_loaded = &drupal_static(__FUNCTION__ . '_fully_loaded');
  if ($reset) {
    $cache = NULL;
    $fully_loaded = FALSE;
  }
  if ($table) {
    if (!isset($cache[$table])) {
      $cid = 'views_data:' . $table;
      $data = views_cache_get($cid, TRUE);
      if (!empty($data->data)) {
        $cache[$table] = $data->data;
      }
      else {
        if (!$fully_loaded) {
          // No cache entry, rebuild.
          $cache = _views_fetch_data_build();
          $fully_loaded = TRUE;
        }
      }
    }
    if (isset($cache[$table])) {
      if (isset($cache[$table]['moved to']) && $move) {
        $moved_table = $cache[$table]['moved to'];
        if (!empty($recursion_protection[$table])) {
          // recursion detected!
          return NULL;
        }
        $recursion_protection[$table] = TRUE;
        $data = _views_fetch_data($moved_table);
        $recursion_protection = array();
        return $data;
      }
      return $cache[$table];
    }
  }
  else {
    if (!$fully_loaded) {
      $data = views_cache_get('views_data', TRUE);
      if (!empty($data->data)) {
        $cache = $data->data;
      }

      if (empty($cache)) {
        $cache = _views_fetch_data_build();
      }
      $fully_loaded = TRUE;
    }
    return $cache;
  }
  // Return an empty array if there is no match.
  return array();
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.