You are here

public function SensorConfig::getThresholdValue in Monitoring 8

Gets the configured threshold value.

Parameters

string $key: Name of the threshold, for example warning or critical.

Return value

int|null The threshold value or NULL if not configured.

Overrides SensorConfigInterface::getThresholdValue

File

src/Entity/SensorConfig.php, line 247
Contains \Drupal\monitoring\Entity\SensorConfig.

Class

SensorConfig
Represents a sensor config entity class.

Namespace

Drupal\monitoring\Entity

Code

public function getThresholdValue($key) {
  if (isset($this->thresholds[$key]) && $this->thresholds[$key] !== '') {
    return $this->thresholds[$key];
  }
}