You are here

protected function ValueComparisonSensorPluginBase::getValueText in Monitoring 8

Gets the current value as text.

Return value

string The expected value.

2 calls to ValueComparisonSensorPluginBase::getValueText()
ConfigValueSensorPlugin::getValueDescription in src/Plugin/monitoring/SensorPlugin/ConfigValueSensorPlugin.php
Gets the value description that will be shown in the settings form.
StateValueSensorPlugin::getValueDescription in src/Plugin/monitoring/SensorPlugin/StateValueSensorPlugin.php
Gets the value description that will be shown in the settings form.

File

src/SensorPlugin/ValueComparisonSensorPluginBase.php, line 44
Contains \Drupal\monitoring\SensorPlugin\ValueComparisonSensorPluginBase

Class

ValueComparisonSensorPluginBase
Provides abstract functionality for a value comparison sensor.

Namespace

Drupal\monitoring\SensorPlugin

Code

protected function getValueText() {
  if ($this->sensorConfig
    ->isBool()) {
    $actual_value = $this
      ->getValue() ? 'TRUE' : 'FALSE';
  }
  else {
    $actual_value = $this
      ->getValue();
  }
  return $actual_value;
}