You are here

public function WebformElementBase::buildExportHeader in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::buildExportHeader()

Build an element's export header.

Parameters

array $element: An element.

array $options: An associative array of export options.

Return value

array An array containing the element's export headers.

Overrides WebformElementInterface::buildExportHeader

See also

\Drupal\webform\WebformSubmissionExporterInterface::getDefaultExportOptions

2 calls to WebformElementBase::buildExportHeader()
OptionsBase::buildExportHeader in src/Plugin/WebformElement/OptionsBase.php
Build an element's export header.
WebformCompositeBase::buildExportHeader in src/Plugin/WebformElement/WebformCompositeBase.php
Build an element's export header.
4 methods override WebformElementBase::buildExportHeader()
OptionsBase::buildExportHeader in src/Plugin/WebformElement/OptionsBase.php
Build an element's export header.
WebformCompositeBase::buildExportHeader in src/Plugin/WebformElement/WebformCompositeBase.php
Build an element's export header.
WebformLikert::buildExportHeader in src/Plugin/WebformElement/WebformLikert.php
Build an element's export header.
WebformMapping::buildExportHeader in src/Plugin/WebformElement/WebformMapping.php
Build an element's export header.

File

src/Plugin/WebformElementBase.php, line 1952

Class

WebformElementBase
Provides a base class for a webform element.

Namespace

Drupal\webform\Plugin

Code

public function buildExportHeader(array $element, array $export_options) {
  if ($export_options['header_format'] === 'label') {
    return [
      $this
        ->getAdminLabel($element),
    ];
  }
  else {
    return [
      $element['#webform_key'],
    ];
  }
}