public function YamlWebformExporter::writeSubmission in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformExporter/YamlWebformExporter.php \Drupal\webform\Plugin\WebformExporter\YamlWebformExporter::writeSubmission()
Write submission to export.
Parameters
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
Overrides WebformExporterBase::writeSubmission
File
- src/
Plugin/ WebformExporter/ YamlWebformExporter.php, line 24
Class
- YamlWebformExporter
- Defines a YAML document exporter.
Namespace
Drupal\webform\Plugin\WebformExporterCode
public function writeSubmission(WebformSubmissionInterface $webform_submission) {
$file_name = $this
->getSubmissionBaseName($webform_submission) . '.yml';
$yaml = WebformYaml::encode($webform_submission
->toArray(TRUE, TRUE));
$this
->addToArchive($yaml, $file_name);
}