You are here

public function WebformSubmissionExporter::writeExportToArchive in Webform 8.5

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

Write export file to Archive file.

Overrides WebformSubmissionExporterInterface::writeExportToArchive

File

src/WebformSubmissionExporter.php, line 843

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);
  }
}