You are here

function views_custom_cache_plugin_cache::get_results_key in Views custom cache 7

Implements views_plugin_cache#get_results_key().

Overrides views_plugin_cache::get_results_key

File

views/views_custom_cache_plugin_cache.inc, line 140
Views custom cache first argument plugin.

Class

views_custom_cache_plugin_cache
Views caching given view's first argument.

Code

function get_results_key() {
  $per_role = isset($this->options['per_role']) ? $this->options['per_role'] : 1;
  $entities = isset($this->options['entities']) ? $this->options['entities'] : 'none';
  $bundles = isset($this->options['bundles']) ? $this->options['bundles'] : array();
  if (!isset($this->_results_key)) {
    $this->_results_key = $this->view->name . ':' . $this->display->id . ':results:' . $this
      ->get_first_arg();
    if ($per_role) {
      $this->_results_key .= ':' . $this
        ->get_cache_key();
    }
    if (!empty($entities) && $entities == 'node') {
      $last_changed = $this
        ->node_get_last_changed_date($bundles);
      $this->_results_key .= ':' . $last_changed;
    }
  }
  return $this->_results_key;
}