You are here

public function MigrateIdMapInterface::saveIdMapping in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/MigrateIdMapInterface.php \Drupal\migrate\Plugin\MigrateIdMapInterface::saveIdMapping()
  2. 10 core/modules/migrate/src/Plugin/MigrateIdMapInterface.php \Drupal\migrate\Plugin\MigrateIdMapInterface::saveIdMapping()

Saves a mapping from the source identifiers to the destination identifiers.

Called upon import of one row, we record a mapping from the source ID to the destination ID. Also may be called, setting the third parameter to NEEDS_UPDATE, to signal an existing record should be re-migrated.

Parameters

\Drupal\migrate\Row $row: The raw source data. We use the ID map derived from the source object to get the source identifier values.

array $destination_id_values: An array of destination identifier values.

int $status: (optional) Status of the source row in the map. Defaults to self::STATUS_IMPORTED.

int $rollback_action: (optional) How to handle the destination object on rollback. Defaults to self::ROLLBACK_DELETE.

2 methods override MigrateIdMapInterface::saveIdMapping()
NullIdMap::saveIdMapping in core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php
Saves a mapping from the source identifiers to the destination identifiers.
Sql::saveIdMapping in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Saves a mapping from the source identifiers to the destination identifiers.

File

core/modules/migrate/src/Plugin/MigrateIdMapInterface.php, line 87

Class

MigrateIdMapInterface
Defines an interface for migrate ID mappings.

Namespace

Drupal\migrate\Plugin

Code

public function saveIdMapping(Row $row, array $destination_id_values, $status = self::STATUS_IMPORTED, $rollback_action = self::ROLLBACK_DELETE);