You are here

public function SensorConfig::getPlugin in Monitoring 8

Gets the sensor plugin.

Return value

\Drupal\monitoring\SensorPlugin\SensorPluginInterface Instantiated sensor.

Overrides SensorConfigInterface::getPlugin

1 call to SensorConfig::getPlugin()
SensorConfig::calculateDependencies in src/Entity/SensorConfig.php
Calculates dependencies and stores them in the dependency property.

File

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

Class

SensorConfig
Represents a sensor config entity class.

Namespace

Drupal\monitoring\Entity

Code

public function getPlugin() {
  $configuration = array(
    'sensor_config' => $this,
  );
  $plugin = monitoring_sensor_manager()
    ->createInstance($this->plugin_id, $configuration);
  return $plugin;
}