You are here

public function DateBase::buildExportRecord in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/DateBase.php \Drupal\webform\Plugin\WebformElement\DateBase::buildExportRecord()

Build an element's export row.

Parameters

array $element: An element.

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

array $export_options: An associative array of export options.

Return value

array An array containing the element's export row.

Overrides WebformElementBase::buildExportRecord

See also

\Drupal\webform\WebformSubmissionExporterInterface::getDefaultExportOptions

File

src/Plugin/WebformElement/DateBase.php, line 241

Class

DateBase
Provides a base 'date' class.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function buildExportRecord(array $element, WebformSubmissionInterface $webform_submission, array $export_options) {
  $element['#format'] = $this
    ->getDateType($element) === 'datetime' ? 'Y-m-d H:i:s' : 'Y-m-d';
  return [
    $this
      ->formatText($element, $webform_submission, $export_options),
  ];
}