You are here

public static function FeedsPlugin::typeOf in Feeds 7

Same name and namespace in other branches
  1. 7.2 plugins/FeedsPlugin.inc \FeedsPlugin::typeOf()

Determines the type of a plugin.

@todo PHP5.3: Implement self::type() and query with $plugin_key::type().

Parameters

$plugin_key: String that identifies a Feeds plugin key.

Return value

One of the following values: 'fetcher' if the plugin is a fetcher 'parser' if the plugin is a parser 'processor' if the plugin is a processor FALSE otherwise.

3 calls to FeedsPlugin::typeOf()
FeedsImporter::setPlugin in includes/FeedsImporter.inc
Set plugin.
FeedsPlugin::byType in plugins/FeedsPlugin.inc
Gets all available plugins of a particular type.
FeedsWebTestCase::setPlugin in tests/feeds.test.inc
Choose a plugin for a importer configuration and assert it.

File

plugins/FeedsPlugin.inc, line 165
Definition of FeedsPlugin class.

Class

FeedsPlugin
Implement source interface for all plugins.

Code

public static function typeOf($plugin_key) {
  if (self::child($plugin_key, 'FeedsFetcher')) {
    return 'fetcher';
  }
  elseif (self::child($plugin_key, 'FeedsParser')) {
    return 'parser';
  }
  elseif (self::child($plugin_key, 'FeedsProcessor')) {
    return 'processor';
  }
  return FALSE;
}