You are here

protected function FeedsHTTPCache::prepareItem in Feeds 7.2

Converts data to a FeedsHTTPCacheItem object, if needed.

Overrides DrupalDatabaseCache::prepareItem

File

includes/FeedsHTTPCache.inc, line 179
Contains FeedsHTTPCache class.

Class

FeedsHTTPCache
Cache implementation for the Feeds HTTP cache.

Code

protected function prepareItem($cache) {
  $cache = parent::prepareItem($cache);
  if (isset($cache->data) && is_object($cache->data) && !$cache->data instanceof FeedsHTTPCacheItem) {

    // Convert to a FeedsHTTPCacheItem object.
    $cache->data = new FeedsHTTPCacheItem($cache->cid, $cache->data);
  }
  return $cache;
}