function views_plugin_cache_time::cache_expire

3.x views_plugin_cache_time.inc views_plugin_cache_time::cache_expire($type)
2.x views_plugin_cache_time.inc views_plugin_cache_time::cache_expire($type)

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

Plugins must override this to implement expiration.

Parameters

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

Overrides views_plugin_cache::cache_expire

File

plugins/views_plugin_cache_time.inc, line 37

Class

views_plugin_cache_time
Simple caching of query results for Views displays.

Code

function cache_expire($type) {
  if ($lifespan = $this->options[$type . '_lifespan']) {
    $cutoff = time() - $lifespan;
    return $cutoff;
  }
  else {
    return FALSE;
  }
}