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.

2 calls to _views_fetch_data()
data_get_views_handler_options in sites/all/modules/local_contrib/data/data.views.inc
Return all available field handlers.
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();
}