abstract class Sensor in Monitoring 7
Abstract SensorInterface implementation with common behaviour.
@todo more
Hierarchy
- class \Drupal\monitoring\Sensor\Sensor implements SensorInterface
Expanded class hierarchy of Sensor
2 files declare their use of Sensor
- SensorCoreRequirements.php in lib/
Drupal/ monitoring/ Sensor/ Sensors/ SensorCoreRequirements.php - Contains \Drupal\monitoring\Sensor\Sensors\SensorCoreRequirements.
- SensorDrupalUpdate.php in lib/
Drupal/ monitoring/ Sensor/ Sensors/ SensorDrupalUpdate.php - Contains \Drupal\monitoring\Sensor\Sensors\SensorDrupalUpdate.
1 string reference to 'Sensor'
- monitoring_drush_result_output_table_multiple in ./
monitoring.drush.inc - Outputs sensor results table for multiple results.
File
- lib/
Drupal/ monitoring/ Sensor/ Sensor.php, line 14 - Contains \Drupal\monitoring\Sensor\Sensor.
Namespace
Drupal\monitoring\SensorView source
abstract class Sensor implements SensorInterface {
/**
* Current sensor info object.
*
* @var SensorInfo
*/
protected $info;
/**
* Instantiates a sensor object.
*
* @param SensorInfo $info
* Sensor info object.
*/
function __construct(SensorInfo $info) {
$this->info = $info;
}
/**
* {@inheritdoc}
*/
public function getSensorName() {
return $this->info
->getName();
}
/**
* {@inheritdoc}
*/
public function isEnabled() {
return (bool) $this->info
->getSetting('enabled');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Sensor:: |
protected | property | Current sensor info object. | |
Sensor:: |
public | function |
Gets sensor name (not the label). Overrides SensorInterface:: |
|
Sensor:: |
public | function |
Determines if sensor is enabled. Overrides SensorInterface:: |
|
Sensor:: |
function | Instantiates a sensor object. | 1 | |
SensorInterface:: |
function | Runs the sensor, updating $sensor_result. | 13 |