You are here

public function MigrateDestinationPluginManager::createInstance in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php \Drupal\migrate\Plugin\MigrateDestinationPluginManager::createInstance()
  2. 9 core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php \Drupal\migrate\Plugin\MigrateDestinationPluginManager::createInstance()

A specific createInstance method is necessary to pass the migration on.

Overrides MigratePluginManager::createInstance

File

core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php, line 57

Class

MigrateDestinationPluginManager
Plugin manager for migrate destination plugins.

Namespace

Drupal\migrate\Plugin

Code

public function createInstance($plugin_id, array $configuration = [], MigrationInterface $migration = NULL) {
  if (substr($plugin_id, 0, 7) == 'entity:' && !$this->entityTypeManager
    ->getDefinition(substr($plugin_id, 7), FALSE)) {
    $plugin_id = 'null';
  }
  return parent::createInstance($plugin_id, $configuration, $migration);
}