You are here

function _feeds_queue_worker_helper in Feeds 7.2

Executes a method on a feed source.

Parameters

array $job: A job definition, which consists of at least the following elements:

  • type (string) The importer ID.
  • id (int) The Feed node ID if the importer is attached to a content type. Otherwise 0.

string $method: The method to execute.

Related topics

3 calls to _feeds_queue_worker_helper()
feeds_source_clear in ./feeds.module
Scheduler callback for deleting all items from a source.
feeds_source_expire in ./feeds.module
Scheduler callback for expiring content.
feeds_source_import in ./feeds.module
Scheduler callback for importing from a source.

File

./feeds.module, line 206
Feeds - basic API functions and hook implementations.

Code

function _feeds_queue_worker_helper(array $job, $method) {
  $source = feeds_source($job['type'], $job['id']);
  try {
    $source
      ->existing()
      ->{$method}();
  } catch (FeedsNotExistingException $e) {

    // Eventually remove the job from job scheduler.
    JobScheduler::get('feeds_source_import')
      ->remove($job);
  } catch (Exception $e) {
    $source
      ->log($method, $e
      ->getMessage(), array(), WATCHDOG_ERROR);
  }
  return $source;
}