public function SensorConfig::getValueLabel in Monitoring 8
Gets sensor value label.
In case the sensor defined a value_label, it will use it as label.
Next if the sensor defines a value_type, it will use the label provided for that type by monitoring_value_types().
If nothing is defined, it returns NULL.
Return value
string|null Sensor value label.
Overrides SensorConfigInterface::getValueLabel
1 call to SensorConfig::getValueLabel()
- SensorConfig::getDefinition in src/
Entity/ SensorConfig.php - Compiles sensor values to an associative array.
File
- src/
Entity/ SensorConfig.php, line 188 - Contains \Drupal\monitoring\Entity\SensorConfig.
Class
- SensorConfig
- Represents a sensor config entity class.
Namespace
Drupal\monitoring\EntityCode
public function getValueLabel() {
if ($this->value_label) {
return $this->value_label;
}
if ($this->value_type) {
$value_types = monitoring_value_types();
if (isset($value_types[$this->value_type]['value_label'])) {
return $value_types[$this->value_type]['value_label'];
}
}
return NULL;
}