You are here

public function PaymentStatusManager::__construct in Payment 8.2

Constructs a new instance.

The string translator.

Parameters

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.

\Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver: The class_resolver.

Overrides DefaultPluginManager::__construct

File

src/Plugin/Payment/Status/PaymentStatusManager.php, line 69

Class

PaymentStatusManager
Manages discovery and instantiation of payment status plugins.

Namespace

Drupal\payment\Plugin\Payment\Status

Code

public function __construct(CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ClassResolverInterface $class_resolver, TranslationInterface $string_translation) {
  $this
    ->alterInfo('payment_status');
  $this
    ->setCacheBackend($cache_backend, 'payment_status', [
    'payment_status',
  ]);
  $this->classResolver = $class_resolver;
  $this->discovery = new YamlDiscovery('payment.status', $module_handler
    ->getModuleDirectories());
  $this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
  $this->factory = new ContainerFactory($this, PaymentStatusInterface::class);
  $this->moduleHandler = $module_handler;
  $this->stringTranslation = $string_translation;
}