class ConfigOperationsProvider in Payment 8.2
Provides payment status operations payment statuses based on config entities.
Hierarchy
- class \Drupal\payment\Plugin\Payment\Status\ConfigOperationsProvider implements ContainerInjectionInterface, PluginOperationsProviderInterface
Expanded class hierarchy of ConfigOperationsProvider
1 file declares its use of ConfigOperationsProvider
- ConfigOperationsProviderTest.php in tests/
src/ Unit/ Plugin/ Payment/ Status/ ConfigOperationsProviderTest.php
1 string reference to 'ConfigOperationsProvider'
File
- src/
Plugin/ Payment/ Status/ ConfigOperationsProvider.php, line 17
Namespace
Drupal\payment\Plugin\Payment\StatusView source
class ConfigOperationsProvider implements PluginOperationsProviderInterface, ContainerInjectionInterface {
/**
* The payment status list builder.
*
* @var \Drupal\Core\Entity\EntityListBuilderInterface
*/
protected $paymentStatusListBuilder;
/**
* The payment status storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $paymentStatusStorage;
/**
* Constructs a new instance.
*
* @param \Drupal\Core\Entity\EntityStorageInterface $payment_status_storage
* The payment status storage.
* @param \Drupal\Core\Entity\EntityListBuilderInterface $payment_status_list_builder
* The payment status list builder.
*/
public function __construct(EntityStorageInterface $payment_status_storage, EntityListBuilderInterface $payment_status_list_builder) {
$this->paymentStatusListBuilder = $payment_status_list_builder;
$this->paymentStatusStorage = $payment_status_storage;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
$entity_type_manager = $container
->get('entity_type.manager');
return new static($entity_type_manager
->getStorage('payment_status'), $entity_type_manager
->getListBuilder('payment_status'));
}
/**
* {@inheritdoc}
*/
public function getOperations($plugin_id) {
$entity_id = substr($plugin_id, 15);
$entity = $this->paymentStatusStorage
->load($entity_id);
return $this->paymentStatusListBuilder
->getOperations($entity);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigOperationsProvider:: |
protected | property | The payment status list builder. | |
ConfigOperationsProvider:: |
protected | property | The payment status storage. | |
ConfigOperationsProvider:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
ConfigOperationsProvider:: |
public | function |
Gets plugin operations. Overrides PluginOperationsProviderInterface:: |
|
ConfigOperationsProvider:: |
public | function | Constructs a new instance. |