Commit bae384ae authored by catch's avatar catch

Issue #2835586 by Grayside, heddn, tjh: Allow customization of stub rows from...

Issue #2835586 by Grayside, heddn, tjh: Allow customization of stub rows from Migration process plugin
parent 5e2e4a86
......@@ -217,7 +217,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
$values[$source_id] = $source_id_values[$migration->id()][$index];
}
$stub_row = new Row($values + $migration->getSourceConfiguration(), $source_ids, TRUE);
$stub_row = $this->createStubRow($values + $migration->getSourceConfiguration(), $source_ids);
// Do a normal migration with the stub row.
$migrate_executable->processRow($stub_row, $process);
......@@ -257,4 +257,23 @@ protected function skipOnEmpty(array $value) {
}
}
/**
* Create a stub row source for later import as stub data.
*
* This simple wrapper of the Row constructor allows sub-classing plugins to
* have more control over the row.
*
* @param array $values
* An array of values to add as properties on the object.
* @param array $source_ids
* An array containing the IDs of the source using the keys as the field
* names.
*
* @return \Drupal\migrate\Row
* The stub row.
*/
protected function createStubRow(array $values, array $source_ids) {
return new Row($values, $source_ids, TRUE);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment