You are here

public function ModerationDeriver::getDerivativeDefinitions in Workbench Moderation to Content Moderation 8.2

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 ContentEntityDeriver::getDerivativeDefinitions

See also

getDerivativeDefinition()

2 calls to ModerationDeriver::getDerivativeDefinitions()
RestoreDeriver::getDerivativeDefinitions in src/Plugin/Deriver/RestoreDeriver.php
Gets the definition of all derivatives of a base plugin.
SaveDeriver::getDerivativeDefinitions in src/Plugin/Deriver/SaveDeriver.php
Gets the definition of all derivatives of a base plugin.
2 methods override ModerationDeriver::getDerivativeDefinitions()
RestoreDeriver::getDerivativeDefinitions in src/Plugin/Deriver/RestoreDeriver.php
Gets the definition of all derivatives of a base plugin.
SaveDeriver::getDerivativeDefinitions in src/Plugin/Deriver/SaveDeriver.php
Gets the definition of all derivatives of a base plugin.

File

src/Plugin/Deriver/ModerationDeriver.php, line 45

Class

ModerationDeriver

Namespace

Drupal\wbm2cm\Plugin\Deriver

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->entityTypeManager
    ->getDefinitions() as $id => $entity_type) {
    if ($this
      ->isCompatible($entity_type)) {
      $derivative = $base_plugin_definition;
      $derivative['id'] .= ":{$id}";
      $this->derivatives[$id] = $derivative;
    }
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}