cckPluginManager = $cck_plugin_manager; $this->fieldPluginManager = $field_plugin_manager; $this->migration = $migration; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('plugin.manager.migrate.cckfield'), $container->get('plugin.manager.migrate.field'), $migration ); } /** * {@inheritdoc} */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { $field_type = is_array($value) ? $value[0] : $value; try { $plugin_id = $this->fieldPluginManager->getPluginIdFromFieldType($field_type, [], $this->migration); return $this->fieldPluginManager->createInstance($plugin_id, [], $this->migration)->getFieldType($row); } catch (PluginNotFoundException $e) { try { $plugin_id = $this->cckPluginManager->getPluginIdFromFieldType($field_type, [], $this->migration); return $this->cckPluginManager->createInstance($plugin_id, [], $this->migration)->getFieldType($row); } catch (PluginNotFoundException $e) { return parent::transform($value, $migrate_executable, $row, $destination_property); } } } }