You are here

public function CheckoutFlowBase::__construct in Commerce Core 8.2

Constructs a new CheckoutFlowBase object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

Overrides PluginBase::__construct

1 call to CheckoutFlowBase::__construct()
CheckoutFlowWithPanesBase::__construct in modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php
Constructs a new CheckoutFlowWithPanesBase object.
1 method overrides CheckoutFlowBase::__construct()
CheckoutFlowWithPanesBase::__construct in modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php
Constructs a new CheckoutFlowWithPanesBase object.

File

modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowBase.php, line 85

Class

CheckoutFlowBase
Provides the base checkout flow class.

Namespace

Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EventDispatcherInterface $event_dispatcher, RouteMatchInterface $route_match) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->entityTypeManager = $entity_type_manager;
  $this->eventDispatcher = $event_dispatcher;
  $this->order = $route_match
    ->getParameter('commerce_order');
  if (array_key_exists('_entity', $configuration)) {
    $this->parentEntity = $configuration['_entity'];
    unset($configuration['_entity']);
  }
  $this
    ->setConfiguration($configuration);
}