You are here

public function Migration::interruptMigration in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::interruptMigration()
  2. 10 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::interruptMigration()

Signal that the migration should be interrupted with the specified result code.

Parameters

int $result: One of the MigrationInterface::RESULT_* constants.

Overrides MigrationInterface::interruptMigration

File

core/modules/migrate/src/Plugin/Migration.php, line 528

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function interruptMigration($result) {
  $this
    ->setStatus(MigrationInterface::STATUS_STOPPING);
  \Drupal::keyValue('migrate_interruption_result')
    ->set($this
    ->id(), $result);
}