You are here

public function SensorResult::getStatusLabel in Monitoring 7

Same name and namespace in other branches
  1. 8 src/Result/SensorResult.php \Drupal\monitoring\Result\SensorResult::getStatusLabel()

Gets a human readable label for the sensor status.

Return value

string Sensor status label.

Overrides SensorResultInterface::getStatusLabel

File

lib/Drupal/monitoring/Result/SensorResult.php, line 130
Contains \Drupal\monitoring\Result\SensorResult.

Class

SensorResult
Generic container for the sensor result.

Namespace

Drupal\monitoring\Result

Code

public function getStatusLabel() {
  $labels = array(
    self::STATUS_CRITICAL => t('Critical'),
    self::STATUS_WARNING => t('Warning'),
    self::STATUS_INFO => t('Info'),
    self::STATUS_OK => t('OK'),
    self::STATUS_UNKNOWN => t('Unknown'),
  );
  return $labels[$this
    ->getResultData('sensor_status')];
}