class RulesActionUserAclDeriver in Content Access 8
Derives Content Access User plugin definitions.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\content_access\Plugin\Deriver\RulesActionUserAclDeriver implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of RulesActionUserAclDeriver
File
- src/
Plugin/ Deriver/ RulesActionUserAclDeriver.php, line 15
Namespace
Drupal\content_access\Plugin\DeriverView source
class RulesActionUserAclDeriver extends DeriverBase implements ContainerDeriverInterface {
use StringTranslationTrait;
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Creates a new RulesActionUserAclDeriver object.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module_handler.
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The string translation service.
*/
public function __construct(ModuleHandlerInterface $module_handler, TranslationInterface $string_translation) {
$this->moduleHandler = $module_handler;
$this->stringTranslation = $string_translation;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('module_handler'), $container
->get('string_translation'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
if ($this->moduleHandler
->moduleExists('acl')) {
$id = $base_plugin_definition['id'];
$this->derivatives[$id] = $base_plugin_definition;
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
RulesActionUserAclDeriver:: |
protected | property | The module handler. | |
RulesActionUserAclDeriver:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
RulesActionUserAclDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
RulesActionUserAclDeriver:: |
public | function | Creates a new RulesActionUserAclDeriver object. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |