You are here

public function PostalCodeWidget::__construct in Postal Code 8

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The 'postal_code.settings' config.

\Drupal\postal_code\PostalCodeValidationInterface $postal_code_validation: The PostalCodeValidation service.

Overrides WidgetBase::__construct

File

src/Plugin/Field/FieldWidget/PostalCodeWidget.php, line 51

Class

PostalCodeWidget
Plugin implementation of the 'postal_code' widget.

Namespace

Drupal\postal_code\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, ConfigFactoryInterface $config_factory, PostalCodeValidationInterface $postal_code_validation) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
  $this->config = $config_factory
    ->get('postal_code.settings');
  $this->postalCodeValidation = $postal_code_validation;
}