public function SensorResult::toArray in Monitoring 7
Same name and namespace in other branches
- 8 src/Result/SensorResult.php \Drupal\monitoring\Result\SensorResult::toArray()
Returns sensor result data as array.
Return value
array An array with data having following keys:
- sensor_name
- value
- expected_value
- numeric_value
- status
- message
- execution_time
- timestamp
Overrides SensorResultInterface::toArray
File
- lib/Drupal/ monitoring/ Result/ SensorResult.php, line 430 
- Contains \Drupal\monitoring\Result\SensorResult.
Class
- SensorResult
- Generic container for the sensor result.
Namespace
Drupal\monitoring\ResultCode
public function toArray() {
  return array(
    'sensor_name' => $this
      ->getSensorName(),
    'value' => $this
      ->getValue(),
    'expected_value' => $this
      ->getExpectedValue(),
    'numeric_value' => $this
      ->toNumber(),
    'status' => $this
      ->getStatus(),
    'message' => $this
      ->getMessage(),
    'execution_time' => $this
      ->getExecutionTime(),
    'timestamp' => $this
      ->getTimestamp(),
  );
}