You are here

public function MultiversionMigration::migrateContentFromTemp in Multiversion 8

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type:

array $field_map:

Return value

\Drupal\multiversion\MultiversionMigrationInterface

Overrides MultiversionMigrationInterface::migrateContentFromTemp

File

src/MultiversionMigration.php, line 165

Class

MultiversionMigration

Namespace

Drupal\multiversion

Code

public function migrateContentFromTemp(EntityTypeInterface $entity_type, $field_map) {
  $id = $entity_type
    ->id() . '__' . MultiversionManager::FROM_TMP;
  $definition = [
    'id' => $id,
    'label' => '',
    'process' => $field_map,
    'source' => [
      'plugin' => 'tempstore',
      'translations' => (bool) $entity_type
        ->getKey('langcode'),
    ],
    'destination' => [
      'plugin' => 'multiversion',
      'translations' => (bool) $entity_type
        ->getKey('langcode'),
    ],
  ];
  $migration = \Drupal::service('plugin.manager.migration')
    ->createStubMigration($definition);
  $this
    ->executeMigration($migration);
  return $this;
}