protected function SensorForm::setThresholdFormError in Monitoring 8
Sets a form error for the given threshold key.
Parameters
string $threshold_key: Key of the threshold value form element.
\Drupal\Core\Form\FormStateInterface $form_state: Drupal form state object.
string $message: The validation message.
1 call to SensorForm::setThresholdFormError()
- SensorForm::validateThresholdsForm in src/
Form/ SensorForm.php
File
- src/
Form/ SensorForm.php, line 423 - Contains \Drupal\monitoring\Form\SensorForm.
Class
- SensorForm
- Sensor settings form controller.
Namespace
Drupal\monitoring\FormCode
protected function setThresholdFormError($threshold_key, FormStateInterface $form_state, $message) {
$form_state
->setErrorByName('plugin_container[thresholds][' . $threshold_key, $message);
}