class EntityBundleInfo in Payment 8.2
Implements hook_entity_bundle_info().
Hierarchy
- class \Drupal\payment\Hook\EntityBundleInfo
Expanded class hierarchy of EntityBundleInfo
See also
1 file declares its use of EntityBundleInfo
- EntityBundleInfoTest.php in tests/
src/ Unit/ Hook/ EntityBundleInfoTest.php
1 string reference to 'EntityBundleInfo'
1 service uses EntityBundleInfo
File
- src/
Hook/ EntityBundleInfo.php, line 12
Namespace
Drupal\payment\HookView source
class EntityBundleInfo {
/**
* The payment method configuration manager.
*
* @var \Drupal\Component\Plugin\PluginManagerInterface
*/
protected $paymentMethodConfigurationManager;
/**
* The payment type manager
*
* @var \Drupal\Component\Plugin\PluginManagerInterface
*/
protected $paymentTypeManager;
/**
* Constructs a new instance.
*
* @param \Drupal\Component\Plugin\PluginManagerInterface $payment_type_manager
* @param \Drupal\Component\Plugin\PluginManagerInterface $payment_method_configuration_manager
*/
public function __construct(PluginManagerInterface $payment_type_manager, PluginManagerInterface $payment_method_configuration_manager) {
$this->paymentMethodConfigurationManager = $payment_method_configuration_manager;
$this->paymentTypeManager = $payment_type_manager;
}
/**
* Invokes the implementation.
*/
public function invoke() {
$bundles = [];
foreach ($this->paymentTypeManager
->getDefinitions() as $plugin_id => $definition) {
$bundles['payment'][$plugin_id] = array(
'label' => $definition['label'],
);
}
foreach ($this->paymentMethodConfigurationManager
->getDefinitions() as $plugin_id => $definition) {
$bundles['payment_method_configuration'][$plugin_id] = array(
'label' => $definition['label'],
);
}
return $bundles;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityBundleInfo:: |
protected | property | The payment method configuration manager. | |
EntityBundleInfo:: |
protected | property | The payment type manager | |
EntityBundleInfo:: |
public | function | Invokes the implementation. | |
EntityBundleInfo:: |
public | function | Constructs a new instance. |