You are here

public static function FeedsPlugin::child in Feeds 7.2

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

Determines whether given plugin is derived from given base plugin.

Parameters

$plugin_key: String that identifies a Feeds plugin key.

$parent_plugin: String that identifies a Feeds plugin key to be tested against.

Return value

TRUE if $parent_plugin is directly *or indirectly* a parent of $plugin, FALSE otherwise.

1 call to FeedsPlugin::child()
FeedsPlugin::typeOf in plugins/FeedsPlugin.inc
Determines the type of a plugin.

File

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

Class

FeedsPlugin
Implement source interface for all plugins.

Code

public static function child($plugin_key, $parent_plugin) {
  ctools_include('plugins');
  $plugins = ctools_get_plugins('feeds', 'plugins');
  if (!isset($plugins[$plugin_key])) {

    // Plugin is not available.
    return FALSE;
  }
  $info = $plugins[$plugin_key];
  if (empty($info['handler']['parent'])) {
    return FALSE;
  }
  elseif ($info['handler']['parent'] == $parent_plugin) {
    return TRUE;
  }
  else {
    return self::child($info['handler']['parent'], $parent_plugin);
  }
}