Constructs a WidgetBase object.
array $plugin_id: The plugin_id for the widget.
array $plugin_definition: The plugin implementation definition.
\Drupal\field\Plugin\Core\Entity\FieldInstance $instance: The field instance to which the widget is associated.
array $settings: The widget settings.
Overrides WidgetBase::__construct
public function __construct($plugin_id, array $plugin_definition, FieldInstance $instance, array $settings) {
// Identify the function used to set the default value.
$instance['default_value_function'] = $this
->defaultValueFunction();
parent::__construct($plugin_id, $plugin_definition, $instance, $settings);
}