public static function BatOption::validateValue in Booking and Availability Management Tools for Drupal 8
Set value as 0 if empty.
File
- modules/
bat_options/ src/ Element/ BatOption.php, line 120 - Contains \Drupal\bat_options\Element\BatOption.
Class
- BatOption
- Plugin annotation @FormElement("bat_option");
Namespace
Drupal\bat_options\ElementCode
public static function validateValue(&$element, FormStateInterface $form_state, &$complete_form) {
$value = $element['#value'];
if ($value === '') {
$form_state
->setValue($element['#parents'], 0);
}
}