You are here

public function ImportWizard::finish in WordPress Migrate 8.3

Form submit handler for finalizing the wizard values.

If you need to generate an entity or save config or raw table data subsequent to your form wizard, this is the responsible method.

Parameters

array $form: Drupal form array.

\Drupal\Core\Form\FormStateInterface $form_state: The final form state of the wizard.

Overrides FormWizardBase::finish

File

wordpress_migrate_ui/src/Wizard/ImportWizard.php, line 82

Class

ImportWizard
Imports the wizard.

Namespace

Drupal\wordpress_migrate_ui\Wizard

Code

public function finish(array &$form, FormStateInterface $form_state) {
  $cached_values = $form_state
    ->getTemporaryValue('wizard');
  $generator = new WordPressMigrationGenerator($cached_values);
  $generator
    ->createMigrations();

  // Go to the dashboard for this migration group.
  $form_state
    ->setRedirect('entity.migration.list', [
    'migration_group' => $cached_values['group_id'],
  ]);
  parent::finish($form, $form_state);
}