You are here

protected function EmailedExport::initializeExporter in Webform Scheduled Tasks 8.2

Get an exporter with initialized settings.

Return value

\Drupal\webform\WebformSubmissionExporterInterface The submissions exporter.

1 call to EmailedExport::initializeExporter()
EmailedExport::executeTask in src/Plugin/WebformScheduledTasks/Task/EmailedExport.php
Execute a task.

File

src/Plugin/WebformScheduledTasks/Task/EmailedExport.php, line 377

Class

EmailedExport
A task which emails an export of a list of webforms.

Namespace

Drupal\webform_scheduled_tasks\Plugin\WebformScheduledTasks\Task

Code

protected function initializeExporter() {

  // Set the scheduled task as the source entity so temporary files generated
  // will be with the context of the scheduled task. This ensures if someone
  // is generating an export from the UI, it does not use the same temporary
  // filenames.
  $this->exporter
    ->setWebform($this
    ->getScheduledTask()
    ->getWebform());
  $this->exporter
    ->setSourceEntity($this
    ->getScheduledTask());
  $exporter_options = $this->configuration['exporter_settings'] + [
    'exporter' => $this->configuration['exporter'],
    'files' => $this->configuration['include_attachments'],
  ];
  $this->exporter
    ->setExporter($exporter_options);
  return $this->exporter;
}