You are here

public static function WebformSubmissionViews::emptyValue in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformSubmissionViews.php \Drupal\webform\Element\WebformSubmissionViews::emptyValue()

Form validate callback which clears the submitted value.

File

src/Element/WebformSubmissionViews.php, line 185

Class

WebformSubmissionViews
Provides a form element for selecting webform submission views.

Namespace

Drupal\webform\Element

Code

public static function emptyValue(&$element, FormStateInterface $form_state, &$complete_form) {
  $element['#value'] = [];
  $form_state
    ->setValueForElement($element, []);
}