Problem/Motivation
When calling `OrangeDamMigrationDataManager::getMigrationBySourceId()` there is no means of limiting the migrations to search, which means a lot of migrations which might be completely irrelevant will also be searched.
I propose something like this:
getMigrationBySourceId(array $migration_ids = [], array $migration_tags = [], array $migration_groups = []) {}
But implementing this as the ability to get migrations filtered by ids, tags, or groups requires quite a few modifications upstream, specifically the function `OrangeDamMigrationDataManager::getMigrations()` would need to have more internals. Currently it only supports filtering by tag.
So, I think for now a suitably humble beginning would be to only support filtering by tags, but we'll do it in a way that supports named arguments, so we can support further changes.
So `getMigrationBySourceId()` becomes `getMigrationBySourceId(array migration_tags = [])`.
And getMigrations changes too:
public function getMigrations(array $migration_tags = []): array {
if (empty($migration_tags)) {
$migration_tags = [static::MIGRATION_TAG];
}
// Migration Plugin Manager createInstancesByTag only supports single tags.
$migrations = [];
foreach ($migration_tags as $tag) {
$migrations = array_merge($migrations, $this->migrationManager->createInstancesByTag($tag));
}
return $migrations;
}
I'll put something together and see what you think.
Issue fork orange_dam-3390961
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
apotek commentedComment #4
apotek commentedReviewed. Now testing.
Comment #6
adamzimmermann commentedComment #7
markdorisonComment #8
adamzimmermann commentedComment #10
markdorison