You are here

public function EntityLookup::__construct in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/migrate/process/EntityLookup.php \Drupal\migrate_plus\Plugin\migrate\process\EntityLookup::__construct()
  2. 8.3 src/Plugin/migrate/process/EntityLookup.php \Drupal\migrate_plus\Plugin\migrate\process\EntityLookup::__construct()

Constructs a \Drupal\Component\Plugin\PluginBase object.

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.

Overrides PluginBase::__construct

1 call to EntityLookup::__construct()
EntityGenerate::__construct in src/Plugin/migrate/process/EntityGenerate.php
EntityGenerate constructor.
1 method overrides EntityLookup::__construct()
EntityGenerate::__construct in src/Plugin/migrate/process/EntityGenerate.php
EntityGenerate constructor.

File

src/Plugin/migrate/process/EntityLookup.php, line 145

Class

EntityLookup
This plugin looks for existing entities.

Namespace

Drupal\migrate_plus\Plugin\migrate\process

Code

public function __construct(array $configuration, $pluginId, $pluginDefinition, MigrationInterface $migration, EntityManagerInterface $entityManager, SelectionPluginManagerInterface $selectionPluginManager) {
  parent::__construct($configuration, $pluginId, $pluginDefinition);
  $this->migration = $migration;
  $this->entityManager = $entityManager;
  $this->selectionPluginManager = $selectionPluginManager;
  $pluginIdParts = explode(':', $this->migration
    ->getDestinationPlugin()
    ->getPluginId());
  $this->destinationEntityType = empty($pluginIdParts[1]) ? NULL : $pluginIdParts[1];
  $this->destinationBundleKey = $this->destinationEntityType ? $this->entityManager
    ->getDefinition($this->destinationEntityType)
    ->getKey('bundle') : NULL;
}