You are here

public function FeedsHTTPCache::set in Feeds 7.2

Implements DrupalCacheInterface::set().

Overrides DrupalDatabaseCache::set

File

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

Class

FeedsHTTPCache
Cache implementation for the Feeds HTTP cache.

Code

public function set($cid, $item, $expire = CACHE_PERMANENT) {
  if ($item instanceof FeedsHTTPCacheItem) {

    // Given item already got rid of the raw data.
    $item
      ->setCid($cid);
    return parent::set($cid, $item, $expire);
  }

  // Create a cache item to only cache what is needed.
  // The cache item will take care of saving the raw data to a file.
  $item = new FeedsHTTPCacheItem($cid, $item);
  parent::set($cid, $item, $expire);
}