You are here

public function Migration::getDestinationPlugin in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::getDestinationPlugin()
  2. 10 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::getDestinationPlugin()

Returns the initialized destination plugin.

Parameters

bool $stub_being_requested: TRUE to indicate that this destination will be asked to construct a stub.

Return value

\Drupal\migrate\Plugin\MigrateDestinationInterface The destination plugin.

Overrides MigrationInterface::getDestinationPlugin

1 call to Migration::getDestinationPlugin()
Migration::checkRequirements in core/modules/migrate/src/Plugin/Migration.php
Checks if requirements for this plugin are OK.

File

core/modules/migrate/src/Plugin/Migration.php, line 398

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function getDestinationPlugin($stub_being_requested = FALSE) {
  if ($stub_being_requested && !empty($this->destination['no_stub'])) {
    throw new MigrateSkipRowException('Stub requested but not made because no_stub configuration is set.');
  }
  if (!isset($this->destinationPlugin)) {
    $this->destinationPlugin = $this->destinationPluginManager
      ->createInstance($this->destination['plugin'], $this->destination, $this);
  }
  return $this->destinationPlugin;
}