You are here

public function MigrateSourceUiForm::getFileExtensionSupported in Migrate source UI 8

The allowed file extension for the migration.

Parameters

\Drupal\migrate\Plugin\Migration $migrationInstance: The migration instance.

Return value

string The file extension.

2 calls to MigrateSourceUiForm::getFileExtensionSupported()
MigrateSourceUiForm::buildForm in src/Form/MigrateSourceUiForm.php
Form constructor.
MigrateSourceUiForm::validateForm in src/Form/MigrateSourceUiForm.php
Form validation handler.

File

src/Form/MigrateSourceUiForm.php, line 197

Class

MigrateSourceUiForm
Contribute form.

Namespace

Drupal\migrate_source_ui\Form

Code

public function getFileExtensionSupported(Migration $migrationInstance) {
  $extension = 'csv';
  if ($migrationInstance
    ->getSourcePlugin() instanceof CSV) {
    $extension = 'csv';
  }
  elseif ($migrationInstance
    ->getSourcePlugin() instanceof Json) {
    $extension = 'json';
  }
  elseif ($migrationInstance
    ->getSourcePlugin() instanceof Xml) {
    $extension = 'xml';
  }
  return $extension;
}