You are here

public function MergeLocalTask::getDerivativeDefinitions in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Plugin/Derivative/MergeLocalTask.php \Drupal\bibcite_entity\Plugin\Derivative\MergeLocalTask::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

modules/bibcite_entity/src/Plugin/Derivative/MergeLocalTask.php, line 44

Class

MergeLocalTask
Provides dynamic tabs based on available formats.

Namespace

Drupal\bibcite_entity\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {

  /* @var \Drupal\Core\Entity\EntityTypeInterface $entity_type  */
  foreach ($this->entityTypeManager
    ->getDefinitions() as $entity_type_id => $entity_type) {
    if ($entity_type
      ->hasLinkTemplate('bibcite-merge-form')) {
      $this->derivatives["entity.{$entity_type_id}.bibcite_merge_form"] = [
        'route_name' => "entity.{$entity_type_id}.bibcite_merge_form",
        'base_route' => "entity.{$entity_type_id}.canonical",
      ] + $base_plugin_definition;
    }
  }
  return $this->derivatives;
}