X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Fsrc%2FPlugin%2Fmigrate%2Fprocess%2FMigrationLookup.php;h=835fd691c9b3bf20c14973f71af72448a1994836;hp=f387df5233fdb7613aa3c806faf5e541401afc0f;hb=bfbba508964731508b9bd6d5835c2edc858db95b;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/web/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php b/web/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php index f387df523..835fd691c 100644 --- a/web/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php +++ b/web/core/modules/migrate/src/Plugin/migrate/process/MigrationLookup.php @@ -217,7 +217,7 @@ class MigrationLookup extends ProcessPluginBase implements ContainerFactoryPlugi $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 @@ class MigrationLookup extends ProcessPluginBase implements ContainerFactoryPlugi } } + /** + * 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); + } + }