You are here

private function ExportPluginManager::generateFileName in Search API Synonym 8

Generate an export file name based on export options.

Return value

string The generated file name.

1 call to ExportPluginManager::generateFileName()
ExportPluginManager::saveSynonymsFile in src/Export/ExportPluginManager.php
Save synonyms data to a file.

File

src/Export/ExportPluginManager.php, line 240

Class

ExportPluginManager
Base class for search api synonym export plugin managers.

Namespace

Drupal\search_api_synonym\Export

Code

private function generateFileName() {
  $options = $this
    ->getExportOptions();

  // Add benning of file name
  $name[] = 'synonyms';

  // Add language code as the first part of the file name.
  $name[] = "lang_{$options['langcode']}";

  // Add type option to file name
  if (!empty($options['type'])) {
    $name[] = "type_{$options['type']}";
  }

  // Add filter option to file name
  if (!empty($options['filter'])) {
    $name[] = "filter_{$options['filter']}";
  }

  // Implode the name parts.
  return implode('__', $name) . '.txt';
}