function NodeTranslationMigrateSubscriber::onPostRowSave
Maps the old nid to the new one in the key value collection.
Parameters
\Drupal\migrate\Event\MigratePostRowSaveEvent $event: The migrate post row save event.
File
-
core/
modules/ node/ src/ EventSubscriber/ NodeTranslationMigrateSubscriber.php, line 79
Class
- NodeTranslationMigrateSubscriber
- Creates a key value collection for migrated node translation mappings.
Namespace
Drupal\node\EventSubscriberCode
public function onPostRowSave(MigratePostRowSaveEvent $event) {
if ($this->isNodeTranslationsMigration($event)) {
$row = $event->getRow();
$source = $row->getSource();
$destination = $row->getDestination();
$collection = $this->keyValue
->get('node_translation_redirect');
$collection->set($source['nid'], [
$destination['nid'],
$destination['langcode'],
]);
}
}