You are here

public function WorkbenchEmailDeriver::getDerivativeDefinitions in Workbench Email 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Derivative/WorkbenchEmailDeriver.php \Drupal\workbench_email\Plugin\Derivative\WorkbenchEmailDeriver::getDerivativeDefinitions()

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/Derivative/WorkbenchEmailDeriver.php, line 59

Class

WorkbenchEmailDeriver
Deriver to define a queue for each entity type.

Namespace

Drupal\workbench_email\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->entityManager
    ->getDefinitions() as $entity_type_id => $entity_type) {
    if ($this
      ->isModeratableEntityType($entity_type)) {
      $this->derivatives[$entity_type_id] = $base_plugin_definition;
      $this->derivatives[$entity_type_id]['id'] = $base_plugin_definition['id'] . ':' . $entity_type_id;
      $this->derivatives[$entity_type_id]['title'] = (string) $base_plugin_definition['title'] . ':' . $entity_type
        ->getLabel();
      $this->derivatives[$entity_type_id]['entity_type'] = $entity_type_id;
      $this->derivatives[$entity_type_id]['base_plugin_title'] = (string) $base_plugin_definition['title'];
    }
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}