You are here

public function TaxonomyTermReference::defineValueProcessPipeline in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php \Drupal\taxonomy\Plugin\migrate\field\TaxonomyTermReference::defineValueProcessPipeline()
  2. 9 core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php \Drupal\taxonomy\Plugin\migrate\field\TaxonomyTermReference::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

File

core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php, line 39

Class

TaxonomyTermReference
Plugin annotation @MigrateField( id = "taxonomy_term_reference", type_map = { "taxonomy_term_reference" = "entity_reference" }, core = {6,7}, source_module = "taxonomy", destination_module = "core", )

Namespace

Drupal\taxonomy\Plugin\migrate\field

Code

public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
  $process = [
    'plugin' => 'sub_process',
    'source' => $field_name,
    'process' => [
      'target_id' => 'tid',
    ],
  ];
  $migration
    ->setProcessOfProperty($field_name, $process);
}