public function WebformExporterBase::addToArchive in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformExporterBase.php \Drupal\webform\Plugin\WebformExporterBase::addToArchive()
Add file, directory, or content to exporter archive.
Parameters
string $path: System path or file content.
string $name: Archive path or file name (applies to file content).
array $options: Tar and zip options.
Overrides WebformExporterInterface::addToArchive
3 calls to WebformExporterBase::addToArchive()
- JsonWebformExporter::writeSubmission in src/
Plugin/ WebformExporter/ JsonWebformExporter.php - Write submission to export.
- WebformEntityPrintWebformExporter::writeSubmission in modules/
webform_entity_print/ src/ Plugin/ WebformExporter/ WebformEntityPrintWebformExporter.php - Write submission to export.
- YamlWebformExporter::writeSubmission in src/
Plugin/ WebformExporter/ YamlWebformExporter.php - Write submission to export.
File
- src/
Plugin/ WebformExporterBase.php, line 309
Class
- WebformExporterBase
- Provides a base class for a results exporter.
Namespace
Drupal\webform\PluginCode
public function addToArchive($path, $name, array $options = []) {
$options += [
'remove_path' => '',
'close' => FALSE,
];
if ($this
->getArchiveType() === WebformExporterInterface::ARCHIVE_ZIP) {
$this
->addToZipFile($path, $name, $options);
}
else {
$this
->addToTarArchive($path, $name, $options);
}
}