You are here

public function ProductBundleWidgetBase::__construct in Commerce Product Bundle 8

Constructs a new ProductBundleWidgetBase 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.

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

Overrides WidgetBase::__construct

1 call to ProductBundleWidgetBase::__construct()
ProductBundleItemsWidget::__construct in src/Plugin/Field/FieldWidget/ProductBundleItemsWidget.php
Constructs a new ProductBundleItemsWidget object.
1 method overrides ProductBundleWidgetBase::__construct()
ProductBundleItemsWidget::__construct in src/Plugin/Field/FieldWidget/ProductBundleItemsWidget.php
Constructs a new ProductBundleItemsWidget object.

File

src/Plugin/Field/FieldWidget/ProductBundleWidgetBase.php, line 79

Class

ProductBundleWidgetBase
Provides the base structure for product bundle widgets.

Namespace

Drupal\commerce_product_bundle\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityTypeManagerInterface $entity_type_manager) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->bundleItemStorage = $entity_type_manager
    ->getStorage('commerce_product_bundle_i');
  $this->productStorage = $entity_type_manager
    ->getStorage('commerce_product');
  $this->variationStorage = $entity_type_manager
    ->getStorage('commerce_product_variation');
  $this->bundleItemOrderItemStorage = $entity_type_manager
    ->getStorage('cpb_order_item');
}