CommerceProductReference.php in Commerce Migrate 8.2
File
modules/commerce/src/Plugin/migrate/field/commerce1/CommerceProductReference.php
View source
<?php
namespace Drupal\commerce_migrate_commerce\Plugin\migrate\field\commerce1;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
class CommerceProductReference extends FieldPluginBase {
public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
$this
->defineValueProcessPipeline($migration, $field_name, $data);
}
public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
'process' => [
'target_id' => 'product_id',
],
];
$migration
->setProcessOfProperty($field_name, $process);
}
public function getFieldWidgetMap() {
return [
'commerce_product_reference_autocomplete' => 'entity_reference_autocomplete',
];
}
}