Skip to content

Instantly share code, notes, and snippets.

@efpapado
Created February 16, 2023 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save efpapado/d049393a6edead10b359681bcea10b86 to your computer and use it in GitHub Desktop.
Save efpapado/d049393a6edead10b359681bcea10b86 to your computer and use it in GitHub Desktop.
diff --git a/src/MigrateBatchExecutable.php b/src/MigrateBatchExecutable.php
index 8e94e6e..6de934e 100644
--- a/src/MigrateBatchExecutable.php
+++ b/src/MigrateBatchExecutable.php
@@ -44,6 +44,13 @@ class MigrateBatchExecutable extends MigrateExecutable {
*/
protected $migrationPluginManager;
+ /**
+ * An array of configuration relevant to the plugin instance.
+ *
+ * @var array
+ */
+ protected $migrationPluginConfiguration = [];
+
/**
* {@inheritdoc}
*/
@@ -59,6 +66,10 @@ class MigrateBatchExecutable extends MigrateExecutable {
parent::__construct($migration, $message, $options);
$this->migrationPluginManager = \Drupal::getContainer()->get('plugin.manager.migration');
+
+ if (isset($options['configuration'])) {
+ $this->migrationPluginConfiguration = $options['configuration'];
+ }
}
/**
@@ -92,6 +103,7 @@ class MigrateBatchExecutable extends MigrateExecutable {
'limit' => $this->itemLimit,
'update' => $this->updateExistingRows,
'force' => $this->checkDependencies,
+ 'configuration' => $this->migrationPluginConfiguration,
]);
if (count($operations) > 0) {
@@ -141,6 +153,7 @@ class MigrateBatchExecutable extends MigrateExecutable {
'limit' => 0,
'update' => $options['update'],
'force' => $options['force'],
+ 'configuration' => $options['configuration'],
]));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment