class ContainerDerivativeDiscoveryDecorator in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php \Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator
Hierarchy
- class \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator implements DiscoveryInterface uses DiscoveryTrait
- class \Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator
Expanded class hierarchy of ContainerDerivativeDiscoveryDecorator
9 files declare their use of ContainerDerivativeDiscoveryDecorator
- BreakpointManager.php in core/
modules/ breakpoint/ src/ BreakpointManager.php - Contains \Drupal\breakpoint\BreakpointManager.
- ConfigMapperManager.php in core/
modules/ config_translation/ src/ ConfigMapperManager.php - Contains \Drupal\config_translation\ConfigMapperManager.
- ContainerDerivativeDiscoveryDecoratorTest.php in core/
tests/ Drupal/ Tests/ Core/ Plugin/ Discovery/ ContainerDerivativeDiscoveryDecoratorTest.php - Contains \Drupal\Tests\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecoratorTest.
- ContextualLinkManager.php in core/
lib/ Drupal/ Core/ Menu/ ContextualLinkManager.php - Contains \Drupal\Core\Menu\ContextualLinkManager.
- DefaultPluginManager.php in core/
lib/ Drupal/ Core/ Plugin/ DefaultPluginManager.php - Contains \Drupal\Core\Plugin\DefaultPluginManager.
File
- core/
lib/ Drupal/ Core/ Plugin/ Discovery/ ContainerDerivativeDiscoveryDecorator.php, line 12 - Contains \Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator.
Namespace
Drupal\Core\Plugin\DiscoveryView source
class ContainerDerivativeDiscoveryDecorator extends DerivativeDiscoveryDecorator {
/**
* {@inheritdoc}
*/
protected function getDeriver($base_plugin_id, $base_definition) {
if (!isset($this->derivers[$base_plugin_id])) {
$this->derivers[$base_plugin_id] = FALSE;
$class = $this
->getDeriverClass($base_definition);
if ($class) {
// If the deriver provides a factory method, pass the container to it.
if (is_subclass_of($class, '\\Drupal\\Core\\Plugin\\Discovery\\ContainerDeriverInterface')) {
/** @var \Drupal\Core\Plugin\Discovery\ContainerDeriverInterface $class */
$this->derivers[$base_plugin_id] = $class::create(\Drupal::getContainer(), $base_plugin_id);
}
else {
$this->derivers[$base_plugin_id] = new $class($base_plugin_id);
}
}
}
return $this->derivers[$base_plugin_id] ?: NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContainerDerivativeDiscoveryDecorator:: |
protected | function |
Gets a deriver for a base plugin. Overrides DerivativeDiscoveryDecorator:: |
|
DerivativeDiscoveryDecorator:: |
protected | property | The decorated plugin discovery. | |
DerivativeDiscoveryDecorator:: |
protected | property | Plugin derivers. | |
DerivativeDiscoveryDecorator:: |
protected | function | Decodes derivative id and plugin id from a string. | |
DerivativeDiscoveryDecorator:: |
protected | function | Encodes plugin and derivative id's into a string. | |
DerivativeDiscoveryDecorator:: |
public | function |
Overrides DiscoveryTrait:: |
|
DerivativeDiscoveryDecorator:: |
public | function |
Overrides DiscoveryTrait:: |
|
DerivativeDiscoveryDecorator:: |
protected | function | Adds derivatives to a list of plugin definitions. | |
DerivativeDiscoveryDecorator:: |
protected | function | Gets the deriver class name from the base plugin definition. | |
DerivativeDiscoveryDecorator:: |
protected | function | Merges a base and derivative definition, taking into account empty values. | |
DerivativeDiscoveryDecorator:: |
public | function | Passes through all unknown calls onto the decorated object. | |
DerivativeDiscoveryDecorator:: |
public | function | Creates a new instance. | |
DiscoveryTrait:: |
protected | function | Gets a specific plugin definition. | |
DiscoveryTrait:: |
public | function |