You are here

public function FormatLocalTask::getDerivativeDefinitions in Bibliography & Citation 8

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

Class

FormatLocalTask
Provides dynamic tabs based on available formats.

Namespace

Drupal\bibcite_entity\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  foreach ($this->formatManager
    ->getDefinitions() as $format_id => $format_definition) {
    $this->derivatives[$format_id] = $base_plugin_definition;
    $this->derivatives[$format_id]['title'] = $format_definition['label'];
    $this->derivatives[$format_id]['route_parameters']['bibcite_format'] = $format_id;
  }
  return $this->derivatives;
}