You are here

public function FeedsImporter::save in Feeds 7

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

Save configuration.

Overrides FeedsConfigurable::save

File

includes/FeedsImporter.inc, line 97
FeedsImporter class and related.

Class

FeedsImporter
A FeedsImporter object describes how an external source should be fetched, parsed and processed. Feeds can manage an arbitrary amount of importers.

Code

public function save() {
  $save = new stdClass();
  $save->id = $this->id;
  $save->config = $this
    ->getConfig();
  if (db_query_range("SELECT 1 FROM {feeds_importer} WHERE id = :id", 0, 1, array(
    ':id' => $this->id,
  ))
    ->fetchField()) {
    drupal_write_record('feeds_importer', $save, 'id');
  }
  else {
    drupal_write_record('feeds_importer', $save);
  }

  // Clear menu cache, changes to importer can change menu items.
  menu_rebuild();
}