PluginDependencyTrait
trait PluginDependencyTrait (View source)
Provides a trait for calculating the dependencies of a plugin.
Traits
Provides a trait for managing an object's dependencies.
Properties
| protected array | $dependencies | The object's dependencies. |
from DependencyTrait |
Methods
Calculates and returns dependencies of a specific plugin instance.
Calculates and adds dependencies of a specific plugin instance.
Wraps the module handler.
Wraps the theme handler.
Details
protected $this
addDependency(string $type, string $name)
Adds a dependency.
protected
addDependencies(array $dependencies)
Adds multiple dependencies.
protected array
getPluginDependencies(PluginInspectionInterface $instance)
Calculates and returns 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.
protected
calculatePluginDependencies(PluginInspectionInterface $instance)
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.
protected ModuleHandlerInterface
moduleHandler()
Wraps the module handler.
protected ThemeHandlerInterface
themeHandler()
Wraps the theme handler.