Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MigrateLookup.php

function MigrateLookup::doLookup

Performs a lookup.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration upon which to perform the lookup.

array $source_id_values: The source ID values to look up.

Return value

array An array of arrays of destination identifier values.

Throws

\Drupal\migrate\MigrateException Thrown when $source_id_values contains unknown keys, or the wrong number of keys.

1 call to MigrateLookup::doLookup()
MigrateLookup::lookup in core/modules/migrate/src/MigrateLookup.php

File

core/modules/migrate/src/MigrateLookup.php, line 70

Class

MigrateLookup
Provides a migration lookup service.

Namespace

Drupal\migrate

Code

protected function doLookup(MigrationInterface $migration, array $source_id_values) {
    $destination_keys = array_keys($migration->getDestinationPlugin()
        ->getIds());
    $indexed_ids = $migration->getIdMap()
        ->lookupDestinationIds($source_id_values);
    $keyed_ids = [];
    foreach ($indexed_ids as $id) {
        $keyed_ids[] = array_combine($destination_keys, $id);
    }
    return $keyed_ids;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal