You are here

public static function OverrideHelper::pluginClass in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::pluginClass()
  2. 8.2 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::pluginClass()
  3. 8.3 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::pluginClass()
  4. 8.4 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::pluginClass()

Overrides the class implementation specified in a plugin definition.

The replacement class is only used if its immediate parent is the class specified by the plugin definition.

Parameters

array $plugin_definition: The plugin definition.

string $replacement_class: The class to use.

1 call to OverrideHelper::pluginClass()
lightning_core_views_plugins_filter_alter in ./lightning_core.module
Implements hook_views_plugins_filter_alter().

File

src/OverrideHelper.php, line 23

Class

OverrideHelper
Helps tweak and override implementations of various things.

Namespace

Drupal\lightning_core

Code

public static function pluginClass(array &$plugin_definition, $replacement_class) {
  if (get_parent_class($replacement_class) == $plugin_definition['class']) {
    $plugin_definition['class'] = $replacement_class;
  }
}