function views_plugin_cache_time::cache_set_expire
3.x views_plugin_cache_time.inc | views_plugin_cache_time::cache_set_expire($type) |
2.x views_plugin_cache_time.inc | views_plugin_cache_time::cache_set_expire($type) |
Determine expiration time in the cache table of the cache type or CACHE_PERMANENT if item shouldn't be removed automatically from cache.
Plugins must override this to implement expiration in the cache table.
Parameters
$type: The cache type, either 'query', 'result' or 'output'.
Overrides views_plugin_cache::cache_set_expire
File
- plugins/
views_plugin_cache_time.inc, line 47
Class
- views_plugin_cache_time
- Simple caching of query results for Views displays.
Code
function cache_set_expire($type) {
if ($lifespan = $this->options[$type . '_lifespan']) {
return time() + $lifespan;
}
else {
return CACHE_PERMANENT;
}
}