You are here

public static function FeedsPlugin::child in Feeds 7

Same name and namespace in other branches
  1. 7.2 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 134
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');
  $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);
  }
}