You are here

public function CommerceProductReference::defineValueProcessPipeline in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 modules/commerce/src/Plugin/migrate/field/commerce1/CommerceProductReference.php \Drupal\commerce_migrate_commerce\Plugin\migrate\field\commerce1\CommerceProductReference::defineValueProcessPipeline()
  2. 3.0.x modules/commerce/src/Plugin/migrate/field/commerce1/CommerceProductReference.php \Drupal\commerce_migrate_commerce\Plugin\migrate\field\commerce1\CommerceProductReference::defineValueProcessPipeline()

Apply any custom processing to the field bundle migrations.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration entity.

string $field_name: The field name we're processing the value for.

array $data: The array of field data from FieldValues::fieldData().

Overrides FieldPluginBase::defineValueProcessPipeline

1 call to CommerceProductReference::defineValueProcessPipeline()
CommerceProductReference::processFieldValues in modules/commerce/src/Plugin/migrate/field/commerce1/CommerceProductReference.php

File

modules/commerce/src/Plugin/migrate/field/commerce1/CommerceProductReference.php, line 33

Class

CommerceProductReference
Field migration for commerce_product reference.

Namespace

Drupal\commerce_migrate_commerce\Plugin\migrate\field\commerce1

Code

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);
}