Adds field collection and paragraph migration dependencies where needed.
array[] $migrations: An associative array of migrations keyed by migration ID, the same that is passed to hook_migration_plugins_alter() hooks.
public function alterMigrationPlugins(array &$migrations) {
foreach ($migrations as &$migration) {
if (!isset($migration['process']) || !is_array($migration['process'])) {
continue;
}
foreach ([
'entity_type',
'targetEntityType',
] as $process_property) {
if (isset($migration['process'][$process_property])) {
$this
->paragraphsMigrationEntityTypeAdjust($migration, $process_property);
$this
->paragraphsMigrationBundleAdjust($migration);
$migration['migration_dependencies']['optional'][] = 'd7_field_collection_type';
$migration['migration_dependencies']['optional'][] = 'd7_paragraphs_type';
}
}
}
}