You are here

public static function FeedsSource::instance in Feeds 8.2

Instantiate a unique object per class/id/feed_nid. Don't use directly, use feeds_source() instead.

Overrides FeedsConfigurable::instance

1 call to FeedsSource::instance()
feeds_source in ./feeds.module
Gets an instance of a source object.

File

lib/Drupal/feeds/FeedsSource.php, line 70
Definition of FeedsSourceInterface and FeedsSource class.

Class

FeedsSource
This class encapsulates a source of a feed. It stores where the feed can be found and how to import it.

Namespace

Drupal\feeds

Code

public static function instance($importer_id, $feed_nid) {
  $class = variable_get('feeds_source_class', 'Drupal\\feeds\\FeedsSource');
  static $instances = array();
  if (!isset($instances[$class][$importer_id][$feed_nid])) {
    $instances[$class][$importer_id][$feed_nid] = new $class($importer_id, $feed_nid);
  }
  return $instances[$class][$importer_id][$feed_nid];
}