You are here

public function FeedsSource::delete in Feeds 7

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

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

File

includes/FeedsSource.inc, line 273
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_delete('feeds_source')
    ->condition('id', $this->id)
    ->condition('feed_nid', $this->feed_nid)
    ->execute();

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