You are here

public function WebformEntityPrintWebformExporterDeriver::getDerivativeDefinitions in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_entity_print/src/Plugin/Derivative/WebformEntityPrintWebformExporterDeriver.php \Drupal\webform_entity_print\Plugin\Derivative\WebformEntityPrintWebformExporterDeriver::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 WebformEntityPrintWebformDeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

modules/webform_entity_print/src/Plugin/Derivative/WebformEntityPrintWebformExporterDeriver.php, line 15

Class

WebformEntityPrintWebformExporterDeriver
Provides webform entity print attachment webform exporter derivatives.

Namespace

Drupal\webform_entity_print\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $definitions = $this
    ->getDefinitions();
  foreach ($definitions as $id => $definition) {
    $t_args = [
      '@label' => $definition['label'],
    ];
    $this->derivatives[$id] = $base_plugin_definition;
    $this->derivatives[$id]['id'] = $id;
    $this->derivatives[$id]['label'] = $this
      ->t('@label documents', $t_args);
    $this->derivatives[$id]['description'] = $this
      ->t('Exports results as @label documents', $t_args);
  }
  return $this->derivatives;
}