class PaymentAwarePluginManagerDecorator in Payment 8.2
Provides a payment-aware plugin manager decorator.
Hierarchy
- class \Drupal\plugin\PluginDiscovery\PluginDiscoveryDecorator implements CachedDiscoveryInterface, DiscoveryInterface uses DiscoveryTrait, DependencySerializationTrait
- class \Drupal\plugin\PluginManager\PluginManagerDecorator implements PluginManagerInterface
- class \Drupal\payment\Plugin\Payment\PaymentAwarePluginManagerDecorator
- class \Drupal\plugin\PluginManager\PluginManagerDecorator implements PluginManagerInterface
Expanded class hierarchy of PaymentAwarePluginManagerDecorator
3 files declare their use of PaymentAwarePluginManagerDecorator
- PaymentAwarePluginFilteredPluginManagerTest.php in tests/
src/ Unit/ Plugin/ Payment/ PaymentAwarePluginFilteredPluginManagerTest.php - PaymentExecutionPaymentMethodManager.php in src/
Plugin/ Payment/ Method/ PaymentExecutionPaymentMethodManager.php - PaymentStatusForm.php in src/
Entity/ Payment/ PaymentStatusForm.php
File
- src/
Plugin/ Payment/ PaymentAwarePluginManagerDecorator.php, line 18
Namespace
Drupal\payment\Plugin\PaymentView source
class PaymentAwarePluginManagerDecorator extends PluginManagerDecorator {
/**
* The payment to inject into plugin instances.
*
* @var \Drupal\payment\Entity\PaymentInterface
*/
protected $payment;
/**
* Creates a new instance.
*
* @param \Drupal\payment\Entity\PaymentInterface $payment
* The payment to inject into payment-aware plugin instances.
* @param \Drupal\Component\Plugin\PluginManagerInterface $plugin_manager
* The decorated plugin manager.
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface|null $discovery
* A plugin discovery to use instead of the decorated plugin manager, or
* NULL to use the decorated plugin manager.
*/
public function __construct(PaymentInterface $payment, PluginManagerInterface $plugin_manager, DiscoveryInterface $discovery = NULL) {
parent::__construct($plugin_manager, $discovery);
$this->payment = $payment;
}
/**
* {@inheritdoc}
*/
public function createInstance($plugin_id, array $configuration = []) {
$plugin = $this->decoratedFactory
->createInstance($plugin_id, $configuration);
if ($plugin instanceof PaymentAwareInterface) {
$plugin
->setPayment($this->payment);
}
return $plugin;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
DiscoveryTrait:: |
protected | function | Gets a specific plugin definition. | |
DiscoveryTrait:: |
public | function | 3 | |
DiscoveryTrait:: |
public | function | ||
PaymentAwarePluginManagerDecorator:: |
protected | property | The payment to inject into plugin instances. | |
PaymentAwarePluginManagerDecorator:: |
public | function |
Creates a pre-configured instance of a plugin. Overrides PluginManagerDecorator:: |
|
PaymentAwarePluginManagerDecorator:: |
public | function |
Creates a new instance. Overrides PluginManagerDecorator:: |
1 |
PluginDiscoveryDecorator:: |
protected | property | The decorated discovery. | |
PluginDiscoveryDecorator:: |
protected | property | The processed plugin definitions. | |
PluginDiscoveryDecorator:: |
protected | property | Whether or not to use plugin caching. | |
PluginDiscoveryDecorator:: |
public | function |
Clears static and persistent plugin definition caches. Overrides CachedDiscoveryInterface:: |
|
PluginDiscoveryDecorator:: |
public | function |
Gets the definition of all plugins for this type. Overrides DiscoveryTrait:: |
|
PluginDiscoveryDecorator:: |
protected | function | Processes the definitions from the decorated discovery. | 2 |
PluginDiscoveryDecorator:: |
public | function |
Disable the use of caches. Overrides CachedDiscoveryInterface:: |
|
PluginManagerDecorator:: |
protected | property | The decorated plugin factory. | |
PluginManagerDecorator:: |
public | function |
Gets a preconfigured instance of a plugin. Overrides MapperInterface:: |