You are here

function feeds_source_clear in Feeds 8.2

Same name and namespace in other branches
  1. 7.2 feeds.module \feeds_source_clear()

Scheduler callback for deleting all items from a source.

Related topics

2 string references to 'feeds_source_clear'
feeds_cron_job_scheduler_info in ./feeds.module
Implements hook_cron_job_scheduler_info().
feeds_queue_info in ./feeds.module
Implements hook_queue_info().

File

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

Code

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

    // Do nothing.
  } catch (Exception $e) {
    $source
      ->log('clear', $e
      ->getMessage(), array(), WATCHDOG_ERROR);
  }
  $source
    ->scheduleClear();
}