Mercurial > hg > isophonics-drupal-site
annotate core/modules/migrate_drupal/src/Plugin/MigrationWithFollowUpInterface.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
rev | line source |
---|---|
Chris@16 | 1 <?php |
Chris@16 | 2 |
Chris@16 | 3 namespace Drupal\migrate_drupal\Plugin; |
Chris@16 | 4 |
Chris@16 | 5 /** |
Chris@16 | 6 * Interface for migrations with follow-up migrations. |
Chris@16 | 7 * |
Chris@16 | 8 * Some migrations need to be derived and executed after other migrations have |
Chris@16 | 9 * been successfully executed. For example, a migration might need to be derived |
Chris@16 | 10 * based on previously migrated data. For such a case, the migration dependency |
Chris@16 | 11 * system is not enough since all migrations would still be derived before any |
Chris@16 | 12 * one of them has been executed. |
Chris@16 | 13 * |
Chris@16 | 14 * Those "follow-up" migrations need to be tagged with the "Follow-up migration" |
Chris@16 | 15 * tag (or any tag in the "follow_up_migration_tags" configuration) and thus |
Chris@16 | 16 * they won't be derived with the other migrations. |
Chris@16 | 17 * |
Chris@16 | 18 * To get those follow-up migrations derived at the right time, the migrations |
Chris@16 | 19 * on which they depend must implement this interface and generate them in the |
Chris@16 | 20 * generateFollowUpMigrations() method. |
Chris@16 | 21 * |
Chris@16 | 22 * When the migrations implementing this interface have been successfully |
Chris@16 | 23 * executed, the follow-up migrations will then be derived having access to the |
Chris@16 | 24 * now migrated data. |
Chris@16 | 25 */ |
Chris@16 | 26 interface MigrationWithFollowUpInterface { |
Chris@16 | 27 |
Chris@16 | 28 /** |
Chris@16 | 29 * Generates follow-up migrations. |
Chris@16 | 30 * |
Chris@17 | 31 * When the migration implementing this interface has been successfully |
Chris@16 | 32 * executed, this method will be used to generate the follow-up migrations |
Chris@16 | 33 * which depends on the now migrated data. |
Chris@16 | 34 * |
Chris@16 | 35 * @return \Drupal\migrate\Plugin\MigrationInterface[] |
Chris@16 | 36 * The follow-up migrations. |
Chris@16 | 37 */ |
Chris@16 | 38 public function generateFollowUpMigrations(); |
Chris@16 | 39 |
Chris@16 | 40 } |