You are here

protected function ExportEnrolments::generateFilePath in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()
  2. 8.6 modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()
  3. 8.8 modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()
  4. 10.3.x modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()
  5. 10.0.x modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()
  6. 10.1.x modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()
  7. 10.2.x modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php \Drupal\social_event_enrolments_export\Plugin\Action\ExportEnrolments::generateFilePath()

Returns a unique file path for this export.

The returned path is relative to getBaseOutputDirectory(). This allows it to work on distributed systems where the temporary file path may change in between batch ticks.

Return value

string The path to the file.

Overrides ExportUser::generateFilePath

File

modules/social_features/social_event/modules/social_event_enrolments_export/src/Plugin/Action/ExportEnrolments.php, line 52

Class

ExportEnrolments
Exports a event enrollment accounts to CSV.

Namespace

Drupal\social_event_enrolments_export\Plugin\Action

Code

protected function generateFilePath() : string {
  $hash = md5(microtime(TRUE));
  return 'export-enrollments-' . substr($hash, 20, 12) . '.csv';
}