You are here

function feedapi_invoke in FeedAPI 5

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

Invoke feedapi API callback functions.

Parameters

$op: "load" Load the feed items basic data into the $feed->items[] "refresh" Re-download the feed and process newly arrived item "purge" Delete all the feed items

$feed: A feed object. If only the ID is known, you should pass something like this: $feed->nid = X

$param: Depends on the $op value.

6 calls to feedapi_invoke()
FeedAPI_Aggregator_Tests::testFeedAPI_Aggregator_Refresh_Feed in feedapi_aggregator/tests/feedapi_aggregator.module.test
Add a content-type, create a feed and refresh it. Check if everything seems ok Delete the feed Check if the rubbish is purged as well. @todo currently it doesn't test the categorizing facility of feedapi_aggregator
feedapi_cron in ./feedapi.module
Implementation of hook_cron().
feedapi_purge_confirm_submit in ./feedapi.module
Submitted items purging form. Drop all the items.
feedapi_refresh in ./feedapi.module
Refresh a feed node (= run enabled processors on it).
_feedapi_insert in ./feedapi.module
Insert feedapi data to the DB when it's a new for for FeedAPI

... See full list

1 string reference to 'feedapi_invoke'
feedapi_menu in ./feedapi.module
Implementation of hook_menu().

File

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

Code

function feedapi_invoke($op, &$feed, $param = NULL) {
  if (!is_object($feed)) {
    return FALSE;
  }
  if (!isset($feed->processors)) {
    $node = node_load($feed->nid);
    if (!isset($node->feed)) {
      return FALSE;
    }
    $feed = $node->feed;
  }
  _feedapi_sanitize_processors($feed);
  switch ($op) {
    case 'load':
      return _feedapi_invoke_load($feed, $param);
    case 'refresh':
      return _feedapi_invoke_refresh($feed, $param);
    case 'purge':
      return _feedapi_invoke_purge($feed, $param);
    default:

      // Other operations
      return _feedapi_invoke($op, $feed, $param);
  }
}