You are here

public static function FeedsConfigurable::instance in Feeds 6

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

Instantiate a FeedsConfigurable object.

Don't use directly, use feeds_importer() or feeds_plugin_instance() instead.

2 calls to FeedsConfigurable::instance()
feeds_importer in ./feeds.module
Gets an importer instance.
feeds_plugin_instance in ./feeds.module
Gets an instance of a class for a given plugin and id.
1 method overrides FeedsConfigurable::instance()
FeedsSource::instance in includes/FeedsSource.inc
Instantiate a unique object per class/id/feed_nid. Don't use directly, use feeds_source() instead.

File

includes/FeedsConfigurable.inc, line 52
FeedsConfigurable and helper functions.

Class

FeedsConfigurable
Base class for configurable classes. Captures configuration handling, form handling and distinguishes between in-memory configuration and persistent configuration.

Code

public static function instance($class, $id) {

  // This is useful at least as long as we're developing.
  if (empty($id)) {
    throw new Exception(t('Empty configuration identifier.'));
  }
  static $instances = array();
  if (!isset($instances[$class][$id])) {
    $instances[$class][$id] = new $class($id);
  }
  return $instances[$class][$id];
}