You are here

public function TaxonomyHierarchySelectionDeriver::getDerivativeDefinitions in Workbench Access 8

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Deriver/TaxonomyHierarchySelectionDeriver.php, line 51

Class

TaxonomyHierarchySelectionDeriver
Defines a deriver for taxonomy hierarchy selection plugins.

Namespace

Drupal\workbench_access\Plugin\Deriver

Code

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;
}