Skip to main content
added 250 characters in body
Source Link
oknate
  • 14.5k
  • 4
  • 53
  • 98

Migrate plus migrations are entities: the following code is adapted from MigrationGroup::delete(), where it finds each migration in a group and deletes them:

$migration_to_delete = 'my_rss_importer'; 
$migration = \Drupal::entityTypeManager()
  ->getStorage('migration')
  ->load($migration_to_delete);
$migration->delete();

Note that this calls Cache::invalidateTags(['migration_plugins']), so after a cache clear, it will remove your cached plugins.

Migrate plus migrations are entities:

$migration_to_delete = 'my_rss_importer'; 
$migration = \Drupal::entityTypeManager()
  ->getStorage('migration')
  ->load($migration_to_delete);
$migration->delete();

Migrate plus migrations are entities: the following code is adapted from MigrationGroup::delete(), where it finds each migration in a group and deletes them:

$migration_to_delete = 'my_rss_importer'; 
$migration = \Drupal::entityTypeManager()
  ->getStorage('migration')
  ->load($migration_to_delete);
$migration->delete();

Note that this calls Cache::invalidateTags(['migration_plugins']), so after a cache clear, it will remove your cached plugins.

Source Link
oknate
  • 14.5k
  • 4
  • 53
  • 98

Migrate plus migrations are entities:

$migration_to_delete = 'my_rss_importer'; 
$migration = \Drupal::entityTypeManager()
  ->getStorage('migration')
  ->load($migration_to_delete);
$migration->delete();