diff core/modules/migrate_drupal/src/Plugin/MigrationWithFollowUpInterface.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents
children 129ea1e6d783
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/migrate_drupal/src/Plugin/MigrationWithFollowUpInterface.php	Tue Jul 10 15:07:59 2018 +0100
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\migrate_drupal\Plugin;
+
+/**
+ * Interface for migrations with follow-up migrations.
+ *
+ * Some migrations need to be derived and executed after other migrations have
+ * been successfully executed. For example, a migration might need to be derived
+ * based on previously migrated data. For such a case, the migration dependency
+ * system is not enough since all migrations would still be derived before any
+ * one of them has been executed.
+ *
+ * Those "follow-up" migrations need to be tagged with the "Follow-up migration"
+ * tag (or any tag in the "follow_up_migration_tags" configuration) and thus
+ * they won't be derived with the other migrations.
+ *
+ * To get those follow-up migrations derived at the right time, the migrations
+ * on which they depend must implement this interface and generate them in the
+ * generateFollowUpMigrations() method.
+ *
+ * When the migrations implementing this interface have been successfully
+ * executed, the follow-up migrations will then be derived having access to the
+ * now migrated data.
+ */
+interface MigrationWithFollowUpInterface {
+
+  /**
+   * Generates follow-up migrations.
+   *
+   * When the migration implementing this interface has been succesfully
+   * executed, this method will be used to generate the follow-up migrations
+   * which depends on the now migrated data.
+   *
+   * @return \Drupal\migrate\Plugin\MigrationInterface[]
+   *   The follow-up migrations.
+   */
+  public function generateFollowUpMigrations();
+
+}