You are here

public function FeedsImporter::copy in Feeds 7.2

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

Copy a FeedsImporter configuration into this importer.

Parameters

FeedsConfigurable $configurable: The feeds importer object to copy from.

Overrides FeedsConfigurable::copy

File

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

Class

FeedsImporter
Class for a Feeds importer.

Code

public function copy(FeedsConfigurable $configurable) {
  parent::copy($configurable);
  if ($configurable instanceof FeedsImporter) {

    // Instantiate new fetcher, parser and processor and initialize their
    // configurations.
    foreach ($this->plugin_types as $plugin_type) {
      $this
        ->setPlugin($configurable->config[$plugin_type]['plugin_key']);
      $this->{$plugin_type}
        ->setConfig($configurable->config[$plugin_type]['config']);
    }
  }
}