public function ProductVariationWidgetBase::__construct in Commerce Core 8.2
Constructs a new ProductVariationWidgetBase 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.
\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.
Overrides WidgetBase::__construct
1 call to ProductVariationWidgetBase::__construct()
- ProductVariationAttributesWidget::__construct in modules/
product/ src/ Plugin/ Field/ FieldWidget/ ProductVariationAttributesWidget.php - Constructs a new ProductVariationAttributesWidget object.
1 method overrides ProductVariationWidgetBase::__construct()
- ProductVariationAttributesWidget::__construct in modules/
product/ src/ Plugin/ Field/ FieldWidget/ ProductVariationAttributesWidget.php - Constructs a new ProductVariationAttributesWidget object.
File
- modules/
product/ src/ Plugin/ Field/ FieldWidget/ ProductVariationWidgetBase.php, line 59
Class
- ProductVariationWidgetBase
- Provides the base structure for product variation widgets.
Namespace
Drupal\commerce_product\Plugin\Field\FieldWidgetCode
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityTypeManagerInterface $entity_type_manager, EntityRepositoryInterface $entity_repository) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
$this->entityRepository = $entity_repository;
$this->variationStorage = $entity_type_manager
->getStorage('commerce_product_variation');
}