You are here

public function FeedsSource::delete in Feeds 6

Same name and namespace in other branches
  1. 7.2 includes/FeedsSource.inc \FeedsSource::delete()
  2. 7 includes/FeedsSource.inc \FeedsSource::delete()

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

File

includes/FeedsSource.inc, line 272
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.

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_query("DELETE FROM {feeds_source} WHERE id = '%s' AND feed_nid = %d", $this->id, $this->feed_nid);

  // Remove from schedule.
  $job = array(
    'callback' => 'feeds_source_import',
    'type' => $this->id,
    'id' => $this->feed_nid,
  );
  job_scheduler()
    ->remove($job);
}