You are here

protected function ProtectionRule::calculatePluginDependencies in User protect 8

Calculates and adds dependencies of a specific plugin instance.

Dependencies are added for the module that provides the plugin, as well as any dependencies declared by the instance's calculateDependencies() method, if it implements \Drupal\Component\Plugin\DependentPluginInterface.

Parameters

\Drupal\Component\Plugin\PluginInspectionInterface $instance: The plugin instance.

Overrides PluginDependencyTrait::calculatePluginDependencies

File

src/Entity/ProtectionRule.php, line 258

Class

ProtectionRule
Defines the Protection rule entity.

Namespace

Drupal\userprotect\Entity

Code

protected function calculatePluginDependencies(PluginInspectionInterface $instance) {

  // Only add dependencies for plugins that are enabled.
  // @see \Drupal\userprotect\Plugin\UserProtection\UserProtectionPluginCollection::getConfiguration()
  if (isset($this->protections[$instance
    ->getPluginId()])) {
    parent::calculatePluginDependencies($instance);
  }
}