You are here

public static function FeedsSource::instance in Feeds 6

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

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

includes/FeedsSource.inc, line 93
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.

Code

public static function instance($importer_id, $feed_nid) {
  $class = variable_get('feeds_source_class', '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];
}