You are here

public function FeedsImporter::save in Feeds 7.2

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

Save configuration.

Overrides FeedsConfigurable::save

File

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

Class

FeedsImporter
Class for a Feeds importer.

Code

public function save() {
  $save = new stdClass();
  $save->id = $this->id;
  $save->config = $this
    ->getConfig();
  if ($config = db_query("SELECT config FROM {feeds_importer} WHERE id = :id", array(
    ':id' => $this->id,
  ))
    ->fetchField()) {
    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);
  }
}