You are here

public function IngredientWidget::__construct in Recipe 8.2

Constructs a IngredientWidget.

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\ingredient\Utility\IngredientUnitUtility $ingredient_unit_utility: The ingredient.unit service.

\Drupal\ingredient\Utility\IngredientQuantityUtility $ingredient_quantity_utility: The ingredient.quantity service.

Overrides WidgetBase::__construct

File

modules/ingredient/src/Plugin/Field/FieldWidget/IngredientWidget.php, line 59

Class

IngredientWidget
Plugin implementation of the 'ingredient_autocomplete' widget.

Namespace

Drupal\ingredient\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, IngredientUnitUtility $ingredient_unit_utility, IngredientQuantityUtility $ingredient_quantity_utility) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->ingredientUnitUtility = $ingredient_unit_utility;
  $this->ingredientQuantityUtility = $ingredient_quantity_utility;
}