You are here

public function FeedsSource::scheduleClear in Feeds 8.2

Schedule background clearing tasks.

File

lib/Drupal/feeds/FeedsSource.php, line 215
Definition of FeedsSourceInterface and FeedsSource class.

Class

FeedsSource
This class encapsulates a source of a feed. It stores where the feed can be found and how to import it.

Namespace

Drupal\feeds

Code

public function scheduleClear() {
  $job = array(
    'type' => $this->id,
    'id' => $this->feed_nid,
    'period' => 0,
    'periodic' => TRUE,
  );

  // Remove job if batch is complete.
  if ($this
    ->progressClearing() === FEEDS_BATCH_COMPLETE) {
    JobScheduler::get('feeds_source_clear')
      ->remove($job);
  }
  else {
    JobScheduler::get('feeds_source_clear')
      ->set($job);
  }
}