You are here

public function WebformSubmissionExporter::writeExportToArchive in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformSubmissionExporter.php \Drupal\webform\WebformSubmissionExporter::writeExportToArchive()

Write export file to Archive file.

Overrides WebformSubmissionExporterInterface::writeExportToArchive

File

src/WebformSubmissionExporter.php, line 884

Class

WebformSubmissionExporter
Webform submission exporter.

Namespace

Drupal\webform

Code

public function writeExportToArchive() {
  $export_file_path = $this
    ->getExportFilePath();
  if (file_exists($export_file_path)) {
    $this
      ->getExporter()
      ->addToArchive($export_file_path, $this
      ->getBaseFileName(), [
      'remove_path' => $this
        ->getFileTempDirectory(),
      'close' => TRUE,
    ]);
    @unlink($export_file_path);
  }
}