You are here

protected static function WebformEntityPrintAttachment::getExportTypeFileExtension in Webform 6.x

Same name in this branch
  1. 6.x modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php \Drupal\webform_entity_print_attachment\Element\WebformEntityPrintAttachment::getExportTypeFileExtension()
  2. 6.x modules/webform_entity_print_attachment/src/Plugin/WebformElement/WebformEntityPrintAttachment.php \Drupal\webform_entity_print_attachment\Plugin\WebformElement\WebformEntityPrintAttachment::getExportTypeFileExtension()
Same name and namespace in other branches
  1. 8.5 modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php \Drupal\webform_entity_print_attachment\Element\WebformEntityPrintAttachment::getExportTypeFileExtension()

Get export type file extension.

Parameters

array $element: An element.

Return value

string An export type file extension.

1 call to WebformEntityPrintAttachment::getExportTypeFileExtension()
WebformEntityPrintAttachment::getFileName in modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php
Get a webform attachment's file name.

File

modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php, line 113

Class

WebformEntityPrintAttachment
Provides a 'webform_entity_print_attachment' element.

Namespace

Drupal\webform_entity_print_attachment\Element

Code

protected static function getExportTypeFileExtension(array $element) {

  /** @var \Drupal\entity_print\Plugin\ExportTypeManagerInterface $export_type_manager */
  $export_type_manager = \Drupal::service('plugin.manager.entity_print.export_type');
  $export_type_id = static::getExportTypeId($element);
  $definition = $export_type_manager
    ->getDefinition($export_type_id);
  return $definition['file_extension'];
}