You are here

public function views_plugin_cache_time::cache_expire in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_cache_time.inc \views_plugin_cache_time::cache_expire()
  2. 6.2 plugins/views_plugin_cache_time.inc \views_plugin_cache_time::cache_expire()

Determine the expiration time of the cache type, or NULL if no expire.

Plugins must override this to implement expiration.

Parameters

string $type: The cache type, either 'query', 'result' or 'output'.

Overrides views_plugin_cache::cache_expire

File

plugins/views_plugin_cache_time.inc, line 109
Definition of views_plugin_cache_time.

Class

views_plugin_cache_time
Simple caching of query results for Views displays.

Code

public function cache_expire($type) {
  $lifespan = $this
    ->get_lifespan($type);
  if ($lifespan) {
    $cutoff = REQUEST_TIME - $lifespan;
    return $cutoff;
  }
  else {
    return FALSE;
  }
}