function PluginDependencyTrait::calculatePluginDependencies

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php \Drupal\Core\Plugin\PluginDependencyTrait::calculatePluginDependencies()
  2. 10 core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php \Drupal\Core\Plugin\PluginDependencyTrait::calculatePluginDependencies()
  3. 11.x core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php \Drupal\Core\Plugin\PluginDependencyTrait::calculatePluginDependencies()

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.

1 call to PluginDependencyTrait::calculatePluginDependencies()
ConfigEntityBase::calculateDependencies in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Calculates dependencies and stores them in the dependency property.

File

core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php, line 88

Class

PluginDependencyTrait
Provides a trait for calculating the dependencies of a plugin.

Namespace

Drupal\Core\Plugin

Code

protected function calculatePluginDependencies(PluginInspectionInterface $instance) {
  $this->addDependencies($this->getPluginDependencies($instance));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.