You are here

public function DateFieldWidgetBase::__construct in Date 8

Constructs a DateWidget object.

Parameters

array $plugin_id: The plugin_id for the widget.

Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery: The Discovery class that holds access to the widget implementation definition.

Drupal\field\FieldInstance $instance: The field instance to which the widget is associated.

array $settings: The widget settings.

int $weight: The widget weight.

File

date_field/lib/Drupal/date_field/Plugin/field/widget/DateFieldWidgetBase.php, line 38
Definition of Drupal\date_field\Plugin\field\widget\DateFieldWidgetBase.

Class

DateFieldWidgetBase
Abstract class for all date widgets.

Namespace

Drupal\date_field\Plugin\field\widget

Code

public function __construct($plugin_id, DiscoveryInterface $discovery, FieldInstance $instance, array $settings, $weight) {

  // Identify the function used to set the default value.
  $instance['default_value_function'] = $this
    ->defaultValueFunction();
  parent::__construct($plugin_id, $discovery, $instance, $settings, $weight);
}