You are here

public function SensorResult::setMessage in Monitoring 7

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

Sets the final result message.

If this is set, then the compilation will not extend the message in any way and the sensor completely responsible for making sure that all relevant information like the sensor value is part of the message.

Parameters

string $message: Message to be set.

array $variables: Dynamic values to be replaced for placeholders in the message.

Overrides SensorResultInterface::setMessage

See also

self::addStatusMessage()

File

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

Class

SensorResult
Generic container for the sensor result.

Namespace

Drupal\monitoring\Result

Code

public function setMessage($message, array $variables = array()) {
  $this->sensorMessage = array(
    'message' => $message,
    'variables' => $variables,
  );
}