You are here

public static function ContentEntityAggregatorSensorPlugin::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 SensorPluginBase::create

See also

\Drupal\Core\Plugin\ContainerFactoryPluginInterface

1 method overrides ContentEntityAggregatorSensorPlugin::create()
CommerceTurnoverSensorPlugin::create in src/Plugin/monitoring/SensorPlugin/CommerceTurnoverSensorPlugin.php
Creates an instance of the sensor with config.

File

src/Plugin/monitoring/SensorPlugin/ContentEntityAggregatorSensorPlugin.php, line 153
Contains \Drupal\monitoring\Plugin\monitoring\SensorPlugin\ContentEntityAggregatorSensorPlugin.

Class

ContentEntityAggregatorSensorPlugin
Content entity database aggregator.

Namespace

Drupal\monitoring\Plugin\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, $container
    ->get('entity_type.manager'), $container
    ->get('entity_field.manager'));
}