class TaxonomyHierarchySelectionDeriver in Workbench Access 8
Defines a deriver for taxonomy hierarchy selection plugins.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\workbench_access\Plugin\Deriver\TaxonomyHierarchySelectionDeriver implements ContainerDeriverInterface
Expanded class hierarchy of TaxonomyHierarchySelectionDeriver
File
- src/
Plugin/ Deriver/ TaxonomyHierarchySelectionDeriver.php, line 13
Namespace
Drupal\workbench_access\Plugin\DeriverView source
class TaxonomyHierarchySelectionDeriver extends DeriverBase implements ContainerDeriverInterface {
/**
* Label.
*
* @var string
*/
protected $label = 'Restricted Taxonomy Term selection: @name';
/**
* Entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs a new SectionViewsPluginDeriver object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* Entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
$this->entityTypeManager = $entityTypeManager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityTypeManager
->getStorage('access_scheme')
->loadMultiple() as $id => $scheme) {
$this->derivatives[$id] = [
'scheme' => $id,
'label' => $scheme
->label(),
] + $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:: |
|
TaxonomyHierarchySelectionDeriver:: |
protected | property | Entity type manager. | |
TaxonomyHierarchySelectionDeriver:: |
protected | property | Label. | 1 |
TaxonomyHierarchySelectionDeriver:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
TaxonomyHierarchySelectionDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
TaxonomyHierarchySelectionDeriver:: |
public | function | Constructs a new SectionViewsPluginDeriver object. |