-
Notifications
You must be signed in to change notification settings - Fork 4
/
dgi_migrate.module
35 lines (30 loc) · 973 Bytes
/
dgi_migrate.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* @file
* Implements module hooks.
*/
use Drupal\dgi_migrate\Plugin\migrate\process\LockingMigrationLookup;
/**
* Implements hook_migration_plugins_alter().
*/
function dgi_migrate_migration_plugins_alter(&$definitions) {
foreach (array_keys($definitions) as $plugin_id) {
if (!isset($definitions[$plugin_id]['idMap']['plugin']) || $definitions[$plugin_id]['idMap']['plugin'] === 'sql') {
$definitions[$plugin_id]['idMap']['plugin'] = 'smart_sql';
}
}
}
/**
* Implements hook_migrate_TYPE_info_alter() for "process" plugins.
*/
function dgi_migrate_migrate_process_info_alter(&$definitions) {
$definitions['dgi_migrate_original_migration_lookup'] =
[
'provider' => 'dgi_migrate',
'id' => 'dgi_migrate_original_migration_lookup',
] +
$definitions['migration_lookup'];
$lookup =& $definitions['migration_lookup'];
$lookup['class'] = LockingMigrationLookup::class;
$lookup['provider'] = 'dgi_migrate';
}