You are here

public static function ModerationStateWidget::validateElement in Thunder 6.1.x

Same name and namespace in other branches
  1. 8.5 modules/thunder_workflow/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\thunder_workflow\Plugin\Field\FieldWidget\ModerationStateWidget::validateElement()
  2. 6.2.x modules/thunder_workflow/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\thunder_workflow\Plugin\Field\FieldWidget\ModerationStateWidget::validateElement()
  3. 6.0.x modules/thunder_workflow/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\thunder_workflow\Plugin\Field\FieldWidget\ModerationStateWidget::validateElement()

Form validation handler for widget elements.

Parameters

array $element: The form element.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Overrides ModerationStateWidget::validateElement

File

modules/thunder_workflow/src/Plugin/Field/FieldWidget/ModerationStateWidget.php, line 84

Class

ModerationStateWidget
Plugin implementation of the 'thunder_moderation_state_default' widget.

Namespace

Drupal\thunder_workflow\Plugin\Field\FieldWidget

Code

public static function validateElement(array $element, FormStateInterface $form_state) {
  $form_state
    ->setValueForElement($element, [
    $element['#key_column'] => $element['#value'],
  ]);
}