You are here

public function DateWidgetBase::__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

lib/Drupal/date/Plugin/field/widget/DateWidgetBase.php, line 39
Definition of Drupal\date\Plugin\field\widget\DateWidgetBase.

Class

DateWidgetBase
Abstract class for all date widgets.

Namespace

Drupal\date\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);
}