You are here

function feeds_plugin in Feeds 8.2

Same name and namespace in other branches
  1. 7.2 feeds.module \feeds_plugin()
  2. 7 feeds.module \feeds_plugin()

Gets an instance of a class for a given plugin and id.

Parameters

$plugin: A string that is the key of the plugin to load.

$id: A string that is the id of the object.

Return value

A FeedsPlugin object.

Throws

Exception If plugin can't be instantiated.

Related topics

7 calls to feeds_plugin()
FeedsImporter::setPlugin in lib/Drupal/feeds/FeedsImporter.php
Set plugin.
FeedsImporter::__construct in lib/Drupal/feeds/FeedsImporter.php
Instantiate class variables, initialize and configure plugins.
feeds_entity_property_info_alter in ./feeds.module
Implements hook_entity_property_info_alter().
feeds_push_unsubscribe in ./feeds.module
Scheduler callback for unsubscribing from PuSH hubs.
feeds_rules_event_info in ./feeds.rules.inc
Implements hook_rules_event_info().

... See full list

File

./feeds.module, line 896
Feeds - basic API functions and hook implementations.

Code

function feeds_plugin($plugin, $id) {
  $info = FeedsPlugin::all();
  if (isset($info[$plugin])) {
    return FeedsConfigurable::instance($info[$plugin]['class'], $id);
  }
}