getDestinationConfiguration example

$this->installConfig(['file']);

    $this->executeMigration('d6_file');
  }

  /** * {@inheritdoc} */
  protected function prepareMigration(MigrationInterface $migration) {
    // File migrations need a source_base_path.     // @see MigrateUpgradeRunBatch::run     $destination = $migration->getDestinationConfiguration();
    if ($destination['plugin'] === 'entity:file') {
      // Make sure we have a single trailing slash.       $source = $migration->getSourceConfiguration();
      $source['site_path'] = 'core/tests/fixtures';
      $source['constants']['source_base_path'] = $this->root . '/';
      $migration->set('source', $source);
    }
  }

}

  protected function isNodeTranslationsMigration(EventBase $event) {
    $migration = $event->getMigration();
    $source_configuration = $migration->getSourceConfiguration();
    $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)) {
      
Home | Imprint | This part of the site doesn't use cookies.