You are here

public function FeedsImporter::save in Feeds 6

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

Save configuration.

Overrides FeedsConfigurable::save

File

includes/FeedsImporter.inc, line 102
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 ($config = db_result(db_query("SELECT config FROM {feeds_importer} WHERE id = '%s'", $this->id))) {
    drupal_write_record('feeds_importer', $save, 'id');

    // Only rebuild menu if content_type has changed. Don't worry about
    // rebuilding menus when creating a new importer since it will default
    // to the standalone page.
    $config = unserialize($config);
    if ($config['content_type'] != $save->config['content_type']) {
      variable_set('menu_rebuild_needed', TRUE);
    }
  }
  else {
    drupal_write_record('feeds_importer', $save);
  }
}