You are here

protected function FeedsSource::__construct in Feeds 7.2

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

Constructor.

Parameters

string $importer_id: The machine name of the importer.

int $feed_nid: The feed node ID for this Feeds source. This should be '0' if the importer is not attached to a content type.

FeedsAccountSwitcherInterface $account_switcher: The account switcher to use to be able to perform actions as a different user.

Overrides FeedsConfigurable::__construct

File

includes/FeedsSource.inc, line 296
Definition of FeedsSourceInterface, FeedsState and FeedsSource class.

Class

FeedsSource
Holds the source of a feed to import.

Code

protected function __construct($importer_id, $feed_nid, FeedsAccountSwitcherInterface $account_switcher = NULL) {
  $this->feed_nid = $feed_nid;
  $this->importer = feeds_importer($importer_id);
  if (is_null($account_switcher)) {
    $this->accountSwitcher = new FeedsAccountSwitcher();
  }
  else {
    $this->accountSwitcher = $account_switcher;
  }
  parent::__construct($importer_id);
  $this
    ->load();
}