class OverridableDerivativeDiscoveryDecorator in Feeds 8.3
Decorator that prefers non-derived plugins over derived ones.
This way plugins that are generated from a deriver can be overridden with a specific one.
Hierarchy
- class \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator implements DiscoveryInterface uses DiscoveryTrait
- class \Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator
- class \Drupal\feeds\Plugin\Discovery\OverridableDerivativeDiscoveryDecorator
- class \Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator
Expanded class hierarchy of OverridableDerivativeDiscoveryDecorator
1 file declares its use of OverridableDerivativeDiscoveryDecorator
- FeedsPluginManager.php in src/
Plugin/ Type/ FeedsPluginManager.php
File
- src/
Plugin/ Discovery/ OverridableDerivativeDiscoveryDecorator.php, line 13
Namespace
Drupal\feeds\Plugin\DiscoveryView source
class OverridableDerivativeDiscoveryDecorator extends ContainerDerivativeDiscoveryDecorator {
/**
* {@inheritdoc}
*/
public function getDefinitions() {
$plugin_definitions = $this->decorated
->getDefinitions();
$derivative_plugin_definitions = [];
foreach ($plugin_definitions as $plugin_id => $plugin_definition) {
if ($this
->getDeriver($plugin_id, $plugin_definition)) {
$derivative_plugin_definitions[$plugin_id] = $plugin_definition;
unset($plugin_definitions[$plugin_id]);
}
}
return $plugin_definitions + $this
->getDerivatives($derivative_plugin_definitions);
}
}
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:: |
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 | ||
OverridableDerivativeDiscoveryDecorator:: |
public | function |
Gets the definition of all plugins for this type. Overrides DerivativeDiscoveryDecorator:: |