isNodeTranslationsMigration example

$destination_configuration = $migration->getDestinationConfiguration();
    return !empty($source_configuration['translations']) && $destination_configuration['plugin'] === 'entity:node';
  }

  /** * Maps the old nid to the new one in the key value collection. * * @param \Drupal\migrate\Event\MigratePostRowSaveEvent $event * The migrate post row save event. */
  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']]);
    }
  }

  /** * Set the node_translation_redirect state to enable the redirections. * * @param \Drupal\migrate\Event\MigrateImportEvent $event * The migrate import event. */
Home | Imprint | This part of the site doesn't use cookies.