function MigrateDestinationPluginManager::createInstance

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php \Drupal\migrate\Plugin\MigrateDestinationPluginManager::createInstance()
  2. 8.9.x core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php \Drupal\migrate\Plugin\MigrateDestinationPluginManager::createInstance()
  3. 10 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 61

Class

MigrateDestinationPluginManager
Plugin manager for migrate destination plugins.

Namespace

Drupal\migrate\Plugin

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.