You are here

public static function CacheHelper::isCacheUnexpired in Helper 7

Check if a cache record is expired or not.

Callback for array_filter() within CacheHelper::get() and CacheHelper::getMultiple().

Parameters

object $cache: A cache object from cache_get().

Return value

bool TRUE if the cache record has not yet expired, or FALSE otherwise.

1 call to CacheHelper::isCacheUnexpired()
CacheHelper::get in lib/CacheHelper.php
A copy of cache_get() that respects expiration.

File

lib/CacheHelper.php, line 41

Class

CacheHelper

Code

public static function isCacheUnexpired($cache) {
  if ($cache->expire > 0 && $cache->expire < REQUEST_TIME) {
    return FALSE;
  }
  return TRUE;
}