You are here

public function SensorPluginBase::addService in Monitoring 8

Service setter.

Parameters

string $id: Service name.

mixed $service: The service to be used in the run method.

Overrides SensorPluginInterface::addService

File

src/SensorPlugin/SensorPluginBase.php, line 75
Contains \Drupal\monitoring\SensorPlugin\SensorPluginBase.

Class

SensorPluginBase
Abstract SensorPluginInterface implementation with common behaviour and will be extended by sensor plugins.

Namespace

Drupal\monitoring\SensorPlugin

Code

public function addService($id, $service) {
  $this->services[$id] = $service;
}