Begin giant move terms function with test of named parameters
As we move this function in from custom code.
This commit is contained in:
parent
e845aa76aa
commit
9df071a382
1 changed files with 27 additions and 0 deletions
|
@ -34,6 +34,33 @@ function migration_helpers_entity_query(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move (and optionally filter/transform) terms between term reference fields.
|
||||||
|
*/
|
||||||
|
function migration_helpers_move_terms(
|
||||||
|
$source_vocabulary,
|
||||||
|
$destination_vocabulary,
|
||||||
|
$source_field,
|
||||||
|
$destination_field,
|
||||||
|
$source_bundle,
|
||||||
|
$destination_bundle = NULL,
|
||||||
|
$source_entity_type = 'node',
|
||||||
|
$destination_entity_type = 'node',
|
||||||
|
$mapping = [],
|
||||||
|
) {
|
||||||
|
// Destination bundle is also required but we default to making it
|
||||||
|
// the same as the source bundle.
|
||||||
|
$destination_bundle ??= $source_bundle;
|
||||||
|
print("
|
||||||
|
$source_entity_type,
|
||||||
|
$source_bundle,
|
||||||
|
$source_field,
|
||||||
|
$destination_entity_type,
|
||||||
|
$destination_bundle,
|
||||||
|
$destination_field,
|
||||||
|
$source_vocabulary,
|
||||||
|
$destination_vocabulary");
|
||||||
|
}
|
||||||
|
|
||||||
// The below almost serve more as examples that can be followed
|
// The below almost serve more as examples that can be followed
|
||||||
|
|
||||||
|
|
Reference in a new issue