public static function ModerationStateWidget::validateElement in Thunder 6.0.x
Same name and namespace in other branches
- 8.5 modules/thunder_workflow/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\thunder_workflow\Plugin\Field\FieldWidget\ModerationStateWidget::validateElement()
- 6.2.x modules/thunder_workflow/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\thunder_workflow\Plugin\Field\FieldWidget\ModerationStateWidget::validateElement()
- 6.1.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\FieldWidgetCode
public static function validateElement(array $element, FormStateInterface $form_state) {
$form_state
->setValueForElement($element, [
$element['#key_column'] => $element['#value'],
]);
}