You are here

public function MigrationStorage::loadMultiple in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/MigrationStorage.php \Drupal\migrate\MigrationStorage::loadMultiple()

Loads one or more entities.

Parameters

$ids: An array of entity IDs, or NULL to load all entities.

Return value

\Drupal\Core\Entity\EntityInterface[] An array of entity objects indexed by their IDs. Returns an empty array if no matching entities are found.

Overrides EntityStorageBase::loadMultiple

File

core/modules/migrate/src/MigrationStorage.php, line 66
Contains \Drupal\migrate\MigrationStorage.

Class

MigrationStorage
Storage for migration entities.

Namespace

Drupal\migrate

Code

public function loadMultiple(array $ids = NULL) {
  if ($ids) {
    $ids = $this
      ->getVariantIds($ids);
  }

  /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */
  $migrations = parent::loadMultiple($ids);
  foreach ($migrations as $migration) {
    $dependencies = array_map([
      $this,
      'getVariantIds',
    ], $migration
      ->getMigrationDependencies());
    $migration
      ->set('migration_dependencies', $dependencies);
  }

  // Build an array of dependencies and set the order of the migrations.
  return $this
    ->buildDependencyMigration($migrations, []);
}