Skip to content

Commit

Permalink
Issue #2912244 by quietone, heddn, FMB: Document MigrateIdMapInterface
Browse files Browse the repository at this point in the history
(cherry picked from commit ff18b59a49d253da1042e1afe63ffdfe9d6c89fd)
  • Loading branch information
alexpott committed Jul 16, 2020
1 parent c8184a6 commit 3ff0512
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions modules/migrate/src/Plugin/MigrateIdMapInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,56 @@
* for audit and rollback purposes. The keys used in the migrate_map table are
* of the form sourceidN and destidN for the source and destination values
* respectively.
*
* The mappings are stored in a migrate_map table with properties:
* - source_ids_hash: A hash of the source IDs.
* - sourceidN: Any number of source IDs defined by a source plugin, where N
* starts at 1, for example, sourceid1, sourceid2 ... sourceidN.
* - destidN: Any number of destination IDs defined by a destination plugin,
* where N starts at 1, for example, destid1, destid2 ... destidN.
* - source_row_status: Indicates current status of the source row, valid
* values are self::STATUS_IMPORTED, self::STATUS_NEEDS_UPDATE,
* self::STATUS_IGNORED or self::STATUS_FAILED.
* - rollback_action: Flag indicating what to do for this item on rollback. This
* property is set in destination plugins. Valid values are
* self::ROLLBACK_DELETE and self::ROLLBACK_PRESERVE.
* - last_imported: UNIX timestamp of the last time the row was imported.
* - hash: A hash of the source row data that is used to detect changes in the
* source data.
*/
interface MigrateIdMapInterface extends \Iterator, PluginInspectionInterface {

/**
* Codes reflecting the current status of a map row.
* Indicates that the import of the row was successful.
*/
const STATUS_IMPORTED = 0;

/**
* Indicates that the row needs to be updated.
*/
const STATUS_NEEDS_UPDATE = 1;

/**
* Indicates that the import of the row was ignored.
*/
const STATUS_IGNORED = 2;

/**
* Indicates that the import of the row failed.
*/
const STATUS_FAILED = 3;

/**
* Codes reflecting how to handle the destination item on rollback.
* Indicates that the data for the row is to be deleted.
*/
const ROLLBACK_DELETE = 0;

/**
* Indicates that the data for the row is to be preserved.
*
* Rows that refer to entities that already exist on the destination and are
* being updated are preserved.
*/
const ROLLBACK_PRESERVE = 1;

/**
Expand Down

0 comments on commit 3ff0512

Please sign in to comment.