abstract class ServiceBase in Purge 8.3
Provides a generic service for all DIC-registered service classes by Purge.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\purge\ServiceBase implements ServiceInterface
Expanded class hierarchy of ServiceBase
8 files declare their use of ServiceBase
- DiagnosticsService.php in src/
Plugin/ Purge/ DiagnosticCheck/ DiagnosticsService.php - InvalidationsService.php in src/
Plugin/ Purge/ Invalidation/ InvalidationsService.php - ProcessorsService.php in src/
Plugin/ Purge/ Processor/ ProcessorsService.php - PurgersService.php in src/
Plugin/ Purge/ Purger/ PurgersService.php - QueuersService.php in src/
Plugin/ Purge/ Queuer/ QueuersService.php
File
- src/
ServiceBase.php, line 10
Namespace
Drupal\purgeView source
abstract class ServiceBase extends ServiceProviderBase implements ServiceInterface {
/**
* The plugin manager for the given service.
*
* @var \Drupal\Component\Plugin\PluginManagerInterface
*/
protected $pluginManager;
/**
* The list of all available plugins and their definitions.
*
* @var null|array
*/
protected $plugins = NULL;
/**
* The list of all enabled plugins and their definitions.
*
* @var null|array
*/
protected $pluginsEnabled = NULL;
/**
* {@inheritdoc}
*/
public function getPlugins() {
if (is_null($this->plugins)) {
$this->plugins = $this->pluginManager
->getDefinitions();
}
return $this->plugins;
}
/**
* {@inheritdoc}
*/
public function getPluginsEnabled() {
if (is_null($this->pluginsEnabled)) {
$this->pluginsEnabled = array_keys($this
->getPlugins());
}
return $this->pluginsEnabled;
}
/**
* {@inheritdoc}
*/
public function isPluginEnabled($plugin_id) {
return in_array($plugin_id, $this
->getPluginsEnabled());
}
/**
* {@inheritdoc}
*/
public function reload() {
$this->plugins = NULL;
$this->pluginsEnabled = NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServiceBase:: |
protected | property | The plugin manager for the given service. | |
ServiceBase:: |
protected | property | The list of all available plugins and their definitions. | |
ServiceBase:: |
protected | property | The list of all enabled plugins and their definitions. | |
ServiceBase:: |
public | function |
Retrieve a list of all available plugins providing the service. Overrides ServiceInterface:: |
1 |
ServiceBase:: |
public | function |
Retrieve the configured plugin_ids that the service will use. Overrides ServiceInterface:: |
6 |
ServiceBase:: |
public | function |
Find out whether the given plugin_id is enabled. Overrides ServiceInterface:: |
|
ServiceBase:: |
public | function |
Reload the service and reinstantiate all enabled plugins. Overrides ServiceInterface:: |
6 |
ServiceProviderBase:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |
5 |
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |