You are here

protected function FeedsImporter::__construct in Feeds 6

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

Instantiate class variables, initialize and configure plugins.

Overrides FeedsConfigurable::__construct

File

includes/FeedsImporter.inc, line 44
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

protected function __construct($id) {
  parent::__construct($id);

  // Try to load information from database.
  $this
    ->load();

  // Instantiate fetcher, parser and processor, set their configuration if
  // stored info is available.
  foreach ($this->plugin_types as $type) {
    $plugin = feeds_plugin_instance($this->config[$type]['plugin_key'], $this->id);
    if (isset($this->config[$type]['config'])) {
      $plugin
        ->setConfig($this->config[$type]['config']);
    }
    $this->{$type} = $plugin;
  }
}