You are here

function apachesolr_views_plugin_cache_time::cache_set in Apache Solr Views 6

Save data to the cache.

A plugin should override this to provide specialized caching behavior.

File

plugins/apachesolr_views_plugin_cache_time.inc, line 12
provides Views caching plugin for solr

Class

apachesolr_views_plugin_cache_time
@file provides Views caching plugin for solr

Code

function cache_set($type) {
  switch ($type) {
    case 'query':

      // Not supported currently, but this is certainly where we'd put it.
      break;
    case 'results':
      $data = array(
        'result' => $this->view->result,
        'total_rows' => $this->view->total_rows,
        'pager' => $this->view->pager,
        'response' => apachesolr_static_response_cache(),
      );
      cache_set($this
        ->get_results_key(), $data, $this->table);
      break;
    case 'output':
      parent::cache_set($type);
      break;
  }
}