1 cache.inc protected BackdropDatabaseCache::prepareItem($cache)

Prepares a cached item.

Checks that items are either permanent or did not expire, and unserializes data as appropriate.

Parameters

$cache: An item loaded from BackdropCacheInterface::get() or BackdropCacheInterface::getMultiple().

Return value

stdClass|FALSE The item with data unserialized as appropriate or FALSE if there is no valid item to load.

File

core/includes/cache.inc, line 508
Functions and interfaces for cache handling.

Class

BackdropDatabaseCache
Defines a default cache implementation.

Code

protected function prepareItem($cache) {
  if (!isset($cache->data)) {
    return FALSE;
  }

  if ($cache->serialized) {
    $cache->data = unserialize($cache->data);
  }

  return $cache;
}