You are here

public function FeedsSource::delete in Feeds 8.2

Delete configuration. Removes configuration information from database, does not delete configuration itself.

File

lib/Drupal/feeds/FeedsSource.php, line 472
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 delete() {

  // Alert implementers of FeedsSourceInterface to the fact that we're
  // deleting.
  foreach ($this->importer->plugin_types as $type) {
    $this->importer->{$type}
      ->sourceDelete($this);
  }
  db_delete('feeds_source')
    ->condition('id', $this->id)
    ->condition('feed_nid', $this->feed_nid)
    ->execute();

  // Remove from schedule.
  $job = array(
    'type' => $this->id,
    'id' => $this->feed_nid,
  );
  JobScheduler::get('feeds_source_import')
    ->remove($job);
  JobScheduler::get('feeds_source_expire')
    ->remove($job);
}