You are here

public function ShippingRateWidget::__construct in Commerce Shipping 8.2

Constructs a new ShippingRateWidget object.

Parameters

string $plugin_id: The plugin_id for the widget.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the widget is associated.

array $settings: The widget settings.

array $third_party_settings: Any third party settings.

\CommerceGuys\Intl\Formatter\CurrencyFormatterInterface $currency_formatter: The currency formatter.

\Drupal\commerce_shipping\ShipmentManagerInterface $shipment_manager: The shipment manager.

Overrides WidgetBase::__construct

File

src/Plugin/Field/FieldWidget/ShippingRateWidget.php, line 67

Class

ShippingRateWidget
Plugin implementation of 'commerce_shipping_rate'.

Namespace

Drupal\commerce_shipping\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, CurrencyFormatterInterface $currency_formatter, ShipmentManagerInterface $shipment_manager) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->currencyFormatter = $currency_formatter;
  $this->shipmentManager = $shipment_manager;
}