annotate core/modules/migrate_drupal/src/Plugin/MigrationWithFollowUpInterface.php @ 4:a9cd425dd02b

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