function MigrateLookup::lookup
Same name in other branches
- 9 core/modules/migrate/src/MigrateLookup.php \Drupal\migrate\MigrateLookup::lookup()
- 8.9.x core/modules/migrate/src/MigrateLookup.php \Drupal\migrate\MigrateLookup::lookup()
- 10 core/modules/migrate/src/MigrateLookup.php \Drupal\migrate\MigrateLookup::lookup()
File
-
core/
modules/ migrate/ src/ MigrateLookup.php, line 35
Class
- MigrateLookup
- Provides a migration lookup service.
Namespace
Drupal\migrateCode
public function lookup($migration_id, array $source_id_values) {
$results = [];
$migrations = $this->migrationPluginManager
->createInstances($migration_id);
if (!$migrations) {
if (is_array($migration_id)) {
if (count($migration_id) != 1) {
throw new PluginException("Plugin IDs '" . implode("', '", $migration_id) . "' were not found.");
}
$migration_id = reset($migration_id);
}
throw new PluginNotFoundException($migration_id);
}
foreach ($migrations as $migration) {
if ($result = $this->doLookup($migration, $source_id_values)) {
$results = array_merge($results, $result);
}
}
return $results;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.