You are here

function views_custom_cache_plugin_cache::cache_set_expire in Views custom cache 7

Implements views_plugin_cache#cache_set_expire().

Determine expiration time in the cache table of the cache type or CACHE_PERMANENT if item shouldn't be removed automatically from cache.

Parameters

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

Overrides views_plugin_cache::cache_set_expire

File

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

Class

views_custom_cache_plugin_cache
Views caching given view's first argument.

Code

function cache_set_expire($type) {
  $expiration_time = $this
    ->get_time();
  if ($expiration_time) {
    return REQUEST_TIME + $expiration_time;
  }
  else {
    return CACHE_PERMANENT;
  }
}