You are here

public static function SensorPluginBase::create in Monitoring 8

Creates an instance of the sensor with config.

Similar to ContainerFactoryPluginInterface but with typed config.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the plugin.

\Drupal\monitoring\Entity\SensorConfig $sensor_config: The configuration containing information about the sensor instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Return value

static Returns an instance of the sensor.

Overrides SensorPluginInterface::create

See also

\Drupal\Core\Plugin\ContainerFactoryPluginInterface

7 methods override SensorPluginBase::create()
ContentEntityAggregatorSensorPlugin::create in src/Plugin/monitoring/SensorPlugin/ContentEntityAggregatorSensorPlugin.php
Creates an instance of the sensor with config.
DatabaseDiskUsagePlugin::create in src/Plugin/monitoring/SensorPlugin/DatabaseDiskUsagePlugin.php
Creates an instance of the sensor with config.
DiskUsageSensorPlugin::create in src/Plugin/monitoring/SensorPlugin/DiskUsageSensorPlugin.php
Creates an instance of the sensor with config.
SolrDiskUsageSensorPlugin::create in src/Plugin/monitoring/SensorPlugin/SolrDiskUsageSensorPlugin.php
Creates an instance of the sensor with config.
SystemLoadSensorPlugin::create in src/Plugin/monitoring/SensorPlugin/SystemLoadSensorPlugin.php
Creates an instance of the sensor with config.

... See full list

File

src/SensorPlugin/SensorPluginBase.php, line 140
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 static function create(ContainerInterface $container, SensorConfig $sensor_config, $plugin_id, $plugin_definition) {
  return new static($sensor_config, $plugin_id, $plugin_definition);
}