cckPluginManager = $cck_manager; $this->fieldPluginManager = $field_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('plugin.manager.migrate.cckfield'), $container->get('plugin.manager.migrate.field'), $container->get('plugin.manager.migration'), $container->get('plugin.manager.migrate.source'), $container->get('plugin.manager.migrate.process'), $container->get('plugin.manager.migrate.destination'), $container->get('plugin.manager.migrate.id_map') ); } /** * {@inheritdoc} */ public function getProcess() { if (!$this->init) { $this->init = TRUE; $source_plugin = $this->migrationPluginManager->createInstance($this->pluginId)->getSourcePlugin(); if ($source_plugin instanceof RequirementsInterface) { try { $source_plugin->checkRequirements(); } catch (RequirementsException $e) { // Kill the rest of the method. $source_plugin = []; } } foreach ($source_plugin as $row) { $field_type = $row->getSourceProperty('type'); try { $plugin_id = $this->fieldPluginManager->getPluginIdFromFieldType($field_type, [], $this); $manager = $this->fieldPluginManager; } catch (PluginNotFoundException $ex) { try { $plugin_id = $this->cckPluginManager->getPluginIdFromFieldType($field_type, [], $this); $manager = $this->cckPluginManager; } catch (PluginNotFoundException $ex) { continue; } } if (!isset($this->processedFieldTypes[$field_type]) && $manager->hasDefinition($plugin_id)) { $this->processedFieldTypes[$field_type] = TRUE; // Allow the field plugin to alter the migration as necessary so that // it knows how to handle fields of this type. if (!isset($this->fieldPluginCache[$field_type])) { $this->fieldPluginCache[$field_type] = $manager->createInstance($plugin_id, [], $this); } } $method = $this->pluginDefinition[static::PLUGIN_METHOD]; call_user_func([$this->fieldPluginCache[$field_type], $method], $this); } } return parent::getProcess(); } }