You are here

public function TempStore::__construct in Multiversion 8

Same name in this branch
  1. 8 src/Plugin/migrate/source/TempStore.php \Drupal\multiversion\Plugin\migrate\source\TempStore::__construct()
  2. 8 src/Plugin/migrate/destination/TempStore.php \Drupal\multiversion\Plugin\migrate\destination\TempStore::__construct()

Constructor.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

MigrationInterface $migration: The migration.

EntityManagerInterface $entity_manager: The entity manager.

KeyValueExpirableFactoryInterface $temp_store_factory: The temp store factory.

Overrides DestinationBase::__construct

File

src/Plugin/migrate/destination/TempStore.php, line 81

Class

TempStore
Plugin annotation @MigrateDestination( id = "tempstore" )

Namespace

Drupal\multiversion\Plugin\migrate\destination

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityManagerInterface $entity_manager, KeyValueExpirableFactoryInterface $temp_store_factory) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
  list($entity_type_id) = explode('__', $migration
    ->id());
  $this->entityManager = $entity_manager;
  $entity_type = $this->entityManager
    ->getDefinition($entity_type_id);
  $this->entityTypeId = $entity_type_id;
  $this->entityIdKey = $entity_type
    ->getKey('id');
  $this->entityLanguageKey = $entity_type
    ->getKey('langcode');
  $this->tempStore = $temp_store_factory
    ->get('multiversion_migration_' . $this->entityTypeId);
}