protected function WebformSubmissionExportImportImporter::importCompositeElement in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.php \Drupal\webform_submission_export_import\WebformSubmissionExportImportImporter::importCompositeElement()
Import composite element.
Parameters
array $element: A composite element.
mixed $value: File URI(s) from CSV record.
\Drupal\webform\WebformSubmissionInterface|null $webform_submission: Existing submission or NULL if new submission.
array $errors: An array of error messages.
Return value
array An array of composite element data.
1 call to WebformSubmissionExportImportImporter::importCompositeElement()
- WebformSubmissionExportImportImporter::importElement in modules/
webform_submission_export_import/ src/ WebformSubmissionExportImportImporter.php - Import element.
File
- modules/
webform_submission_export_import/ src/ WebformSubmissionExportImportImporter.php, line 873
Class
- WebformSubmissionExportImportImporter
- Webform submission export import manager.
Namespace
Drupal\webform_submission_export_importCode
protected function importCompositeElement(array $element, $value, WebformSubmissionInterface $webform_submission = NULL, array &$errors) {
try {
return Yaml::decode($value);
} catch (\Exception $exception) {
$t_args = [
'@element_key' => $element['#webform_key'],
'@error' => $exception
->getMessage(),
];
$errors[] = $this
->t('[@element_key] YAML is not valid. @error', $t_args);
return [];
}
}