You are here

protected function DomMigrationLookup::migrationLookup in Migrate Plus 8.5

Lookup the migration mapped ID on one migration.

Parameters

mixed $id: The ID to search with migration_lookup process plugin.

string $migration_name: The migration to look into machine name.

Return value

string|null The found mapped ID, or NULL if not found on the provided migration.

1 call to DomMigrationLookup::migrationLookup()
DomMigrationLookup::transform in src/Plugin/migrate/process/DomMigrationLookup.php
Performs the associated process.

File

src/Plugin/migrate/process/DomMigrationLookup.php, line 207

Class

DomMigrationLookup
String replacements on a source dom based on migration lookup.

Namespace

Drupal\migrate_plus\Plugin\migrate\process

Code

protected function migrationLookup($id, $migration_name) {
  $mapped_id = NULL;
  $parameters = [
    $id,
    $this->transformParameters['migrate_executable'],
    $this->transformParameters['row'],
    $this->transformParameters['destination_property'],
  ];
  $plugin_configuration = [
    'migration' => $migration_name,
    'no_stub' => $this->configuration['no_stub'],
  ];
  $migration_lookup_plugin = $this->processPluginManager
    ->createInstance('migration_lookup', $plugin_configuration, $this->migration);
  $mapped_id = call_user_func_array([
    $migration_lookup_plugin,
    'transform',
  ], $parameters);
  return $mapped_id;
}