Fichier

src/Plugin/Derivative/EntityCloneContextualLinks.php, line 57

Classe

EntityCloneContextualLinks
Class EntityCloneContextualLinks

Namespace

Drupal\entity_clone\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
    // Create contextual links for entity clone.
    foreach ($this->entityTypeManager
        ->getDefinitions() as $entity_type_id => $entity_type) {
        $this->derivatives["{$entity_type_id}.clone_tab"] = [
            'route_name' => "entity.{$entity_type_id}.clone_form",
            'title' => $this->translationManager
                ->translate('Clone'),
            'group' => $entity_type_id,
        ];
    }
    return parent::getDerivativeDefinitions($base_plugin_definition);
}