ServiceBase.php in Purge 8.3
File
src/ServiceBase.php
View source
<?php
namespace Drupal\purge;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
abstract class ServiceBase extends ServiceProviderBase implements ServiceInterface {
protected $pluginManager;
protected $plugins = NULL;
protected $pluginsEnabled = NULL;
public function getPlugins() {
if (is_null($this->plugins)) {
$this->plugins = $this->pluginManager
->getDefinitions();
}
return $this->plugins;
}
public function getPluginsEnabled() {
if (is_null($this->pluginsEnabled)) {
$this->pluginsEnabled = array_keys($this
->getPlugins());
}
return $this->pluginsEnabled;
}
public function isPluginEnabled($plugin_id) {
return in_array($plugin_id, $this
->getPluginsEnabled());
}
public function reload() {
$this->plugins = NULL;
$this->pluginsEnabled = NULL;
}
}
Classes
Name |
Description |
ServiceBase |
Provides a generic service for all DIC-registered service classes by Purge. |