You are here

public function ContentEntityLingotekActionDeriver::getDerivativeDefinitions in Lingotek Translation 4.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  2. 3.0.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  3. 3.1.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  4. 3.2.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  5. 3.3.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  6. 3.4.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  7. 3.5.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  8. 3.6.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  9. 3.7.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::getDerivativeDefinitions()
  10. 3.8.x src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php \Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver::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 EntityActionDeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Action/Derivative/ContentEntityLingotekActionDeriver.php, line 27

Class

ContentEntityLingotekActionDeriver

Namespace

Drupal\lingotek\Plugin\Action\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $definitions = parent::getDerivativeDefinitions($base_plugin_definition);
  if (!empty($definitions)) {
    $entity_types = $this->entityTypeManager
      ->getDefinitions();
    foreach ($this->derivatives as $entity_type_id => &$definition) {
      $definition['label'] = new FormattableMarkup($base_plugin_definition['action_label'], [
        '@entity_label' => $entity_types[$entity_type_id]
          ->getSingularLabel(),
      ]);
      if (in_array($definition['class'], [
        DeleteAllTranslationsAction::class,
        DeleteTranslationLingotekAction::class,
      ])) {
        $definition['confirm_form_route_name'] = 'entity.' . $entity_type_id . '.delete_multiple_form';
      }
    }
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}