You are here

function feedapi_expire in FeedAPI 5

Same name and namespace in other branches
  1. 6 feedapi.module \feedapi_expire()

Delete expired items and return informations about the feed refreshing

Parameters

$feed: The feed object

$force: Not in use anymore. Will be removed in future releases.

$settings: Optional feed settings

Return value

FALSE if the feed don't have to be refreshed. (forbidden if the $force is TRUE)

1 call to feedapi_expire()
_feedapi_invoke_refresh in ./feedapi.module
Helper function for feedapi_invoke(). Refresh the feed, call the proper parsers and processors' hooks. Don't call this function directly, use feedapi_refresh() instead.

File

./feedapi.module, line 340
Handle the submodules (for feed and item processing) Provide a basic management of feeds

Code

function feedapi_expire($feed, $settings = NULL) {

  // Backwards compatibility, get settings if not passed
  $settings = is_null($settings) ? feedapi_get_settings(NULL, $feed->nid) : $settings;

  // Each processor can have its own expiration criteria ?
  $expired = _feedapi_invoke('expire', $feed, $settings);

  // Return the number of expired items
  return $expired ? array_sum($expired) : 0;
}