You are here

protected function SensorThresholds::setFormError in Monitoring 7

Sets a form error for the given threshold key.

Parameters

string $threshold_key: Key of the treshold value form element.

string $message: The validation message.

1 call to SensorThresholds::setFormError()
SensorThresholds::settingsFormValidate in lib/Drupal/monitoring/Sensor/SensorThresholds.php
Form validator for a sensor settings form.

File

lib/Drupal/monitoring/Sensor/SensorThresholds.php, line 153
Contains \Drupal\monitoring\Sensor\SensorThresholds.

Class

SensorThresholds
Abstract class providing configuration form for Sensor with thresholds.

Namespace

Drupal\monitoring\Sensor

Code

protected function setFormError($threshold_key, $message) {
  $form_key = monitoring_sensor_settings_key($this->info
    ->getName());
  form_set_error($form_key . '][thresholds][' . $threshold_key, $message);
}