public function YamlYamlFormExporter::writeSubmission in YAML Form 8
Write submission to export.
Parameters
\Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission: A form submission.
Overrides YamlFormExporterBase::writeSubmission
File
- src/
Plugin/ YamlFormExporter/ YamlYamlFormExporter.php, line 26
Class
- YamlYamlFormExporter
- Defines a YAML document exporter.
Namespace
Drupal\yamlform\Plugin\YamlFormExporterCode
public function writeSubmission(YamlFormSubmissionInterface $yamlform_submission) {
$file_name = $this
->getSubmissionBaseName($yamlform_submission) . '.yml';
$yaml = Yaml::encode($yamlform_submission
->toArray(TRUE));
$yaml = YamlFormTidy::tidy($yaml);
$archiver = new ArchiveTar($this
->getArchiveFilePath(), 'gz');
$archiver
->addString($file_name, $yaml);
}