public function WebformMapping::buildExportRecord in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformElement/WebformMapping.php \Drupal\webform\Plugin\WebformElement\WebformMapping::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/ WebformMapping.php, line 272
Class
- WebformMapping
- Provides a 'mapping' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function buildExportRecord(array $element, WebformSubmissionInterface $webform_submission, array $export_options) {
$value = $this
->getValue($element, $webform_submission);
$record = [];
foreach ($element['#source'] as $source_key => $source_title) {
$record[] = isset($value[$source_key]) ? $value[$source_key] : NULL;
}
return $record;
}