function Migration::getProcessPlugins

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::getProcessPlugins()
  2. 8.9.x core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::getProcessPlugins()
  3. 10 core/modules/migrate/src/Plugin/Migration.php \Drupal\migrate\Plugin\Migration::getProcessPlugins()

Overrides MigrationInterface::getProcessPlugins

File

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

Class

Migration
Defines the Migration plugin.

Namespace

Drupal\migrate\Plugin

Code

public function getProcessPlugins(?array $process = NULL) {
    $process = isset($process) ? $this->getProcessNormalized($process) : $this->getProcess();
    $index = serialize($process);
    if (!isset($this->processPlugins[$index])) {
        $this->processPlugins[$index] = [];
        foreach ($process as $property => $configurations) {
            $this->processPlugins[$index][$property] = [];
            foreach ($configurations as $configuration) {
                if (isset($configuration['source'])) {
                    $this->processPlugins[$index][$property][] = $this->processPluginManager
                        ->createInstance('get', $configuration, $this);
                }
                // Get is already handled.
                if ($configuration['plugin'] != 'get') {
                    $this->processPlugins[$index][$property][] = $this->processPluginManager
                        ->createInstance($configuration['plugin'], $configuration, $this);
                }
                if (!$this->processPlugins[$index][$property]) {
                    throw new MigrateException("Invalid process configuration for {$property}");
                }
            }
        }
    }
    return $this->processPlugins[$index];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.