class DevelGeneratePermissions
Same name in other branches
- 5.x devel_generate/src/DevelGeneratePermissions.php \Drupal\devel_generate\DevelGeneratePermissions
Provides dynamic permissions of the filter module.
Hierarchy
- class \Drupal\devel_generate\DevelGeneratePermissions implements \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait
Expanded class hierarchy of DevelGeneratePermissions
File
-
devel_generate/
src/ DevelGeneratePermissions.php, line 12
Namespace
Drupal\devel_generateView source
class DevelGeneratePermissions implements ContainerInjectionInterface {
use StringTranslationTrait;
/**
* The plugin manager.
*
* @var \Drupal\devel_generate\DevelGeneratePluginManager
*/
protected $develGeneratePluginManager;
/**
* Constructs a new DevelGeneratePermissions instance.
*
* @param \Drupal\devel_generate\DevelGeneratePluginManager $develGeneratePluginManager
* The plugin manager.
*/
public function __construct(DevelGeneratePluginManager $develGeneratePluginManager) {
$this->develGeneratePluginManager = $develGeneratePluginManager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container->get('plugin.manager.develgenerate'));
}
/**
* A permissions callback.
*
* @see devel_generate.permissions.yml
*
* @return array
* An array of permissions for all plugins.
*/
public function permissions() {
$devel_generate_plugins = $this->develGeneratePluginManager
->getDefinitions();
foreach ($devel_generate_plugins as $plugin) {
$permission = $plugin['permission'];
$permissions[$permission] = [
'title' => $this->t('@permission', [
'@permission' => $permission,
]),
];
}
return $permissions;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
DevelGeneratePermissions::$develGeneratePluginManager | protected | property | The plugin manager. | ||
DevelGeneratePermissions::create | public static | function | Instantiates a new instance of this class. | Overrides ContainerInjectionInterface::create | |
DevelGeneratePermissions::permissions | public | function | A permissions callback. | ||
DevelGeneratePermissions::__construct | public | function | Constructs a new DevelGeneratePermissions instance. | ||
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | |
StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | ||
StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | ||
StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | ||
StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | |
StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. |