You are here

public function FedEx::__construct in Commerce FedEx 8

Constructs a new ShippingMethodBase 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\commerce_shipping\PackageTypeManagerInterface $package_type_manager: The package type manager.

\Drupal\state_machine\WorkflowManagerInterface $workflow_manager: The workflow manager.

\Drupal\commerce_fedex\FedExPluginManager $fedex_service_manager: The FedEx Plugin Manager.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: The Event Dispatcher.

\Drupal\commerce_fedex\FedExRequestInterface $fedex_request: The Fedex Request Service.

\Psr\Log\LoggerInterface $watchdog: Commerce Fedex Logger Channel.

\Drupal\commerce_price\RounderInterface $rounder: The price rounder.

Overrides ShippingMethodBase::__construct

File

src/Plugin/Commerce/ShippingMethod/FedEx.php, line 164

Class

FedEx
Provides the FedEx shipping method.

Namespace

Drupal\commerce_fedex\Plugin\Commerce\ShippingMethod

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, PackageTypeManagerInterface $package_type_manager, WorkflowManagerInterface $workflow_manager, FedExPluginManager $fedex_service_manager, EventDispatcherInterface $event_dispatcher, FedExRequestInterface $fedex_request, LoggerInterface $watchdog, RounderInterface $rounder) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $package_type_manager, $workflow_manager);
  $this->watchdog = $watchdog;
  $this->fedExRequest = $fedex_request;
  $this->fedExServiceManager = $fedex_service_manager;
  $this->eventDispatcher = $event_dispatcher;
  $this->rounder = $rounder;
  if (empty($this->configuration['plugins'])) {
    $this->configuration['plugins'] = [];
  }
  $this
    ->updatePlugins()
    ->getPlugins();
}