YamlWebformExporter.php in Webform 8.5
File
src/Plugin/WebformExporter/YamlWebformExporter.php
View source
<?php
namespace Drupal\webform\Plugin\WebformExporter;
use Drupal\webform\Utility\WebformYaml;
use Drupal\webform\WebformSubmissionInterface;
class YamlWebformExporter extends DocumentBaseWebformExporter {
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);
}
}