FileField.php

Same filename in this branch
  1. 9 core/modules/file/src/Plugin/migrate/field/d6/FileField.php
Same filename in other branches
  1. 8.9.x core/modules/file/src/Plugin/migrate/field/d6/FileField.php
  2. 8.9.x core/modules/file/src/Plugin/migrate/field/d7/FileField.php
  3. 8.9.x core/modules/file/src/Plugin/migrate/cckfield/d6/FileField.php
  4. 8.9.x core/modules/file/src/Plugin/migrate/cckfield/d7/FileField.php
  5. 10 core/modules/file/src/Plugin/migrate/field/d6/FileField.php
  6. 10 core/modules/file/src/Plugin/migrate/field/d7/FileField.php
  7. 11.x core/modules/file/src/Plugin/migrate/field/d6/FileField.php
  8. 11.x core/modules/file/src/Plugin/migrate/field/d7/FileField.php

Namespace

Drupal\file\Plugin\migrate\field\d7

File

core/modules/file/src/Plugin/migrate/field/d7/FileField.php

View source
<?php

namespace Drupal\file\Plugin\migrate\field\d7;

use Drupal\file\Plugin\migrate\field\d6\FileField as D6FileField;
use Drupal\migrate\Plugin\MigrationInterface;
// cspell:ignore filefield

/**
 * @MigrateField(
 *   id = "file",
 *   core = {7},
 *   source_module = "file",
 *   destination_module = "file"
 * )
 */
class FileField extends D6FileField {
    
    /**
     * {@inheritdoc}
     */
    public function getFieldWidgetMap() {
        return [
            'file_mfw' => 'file_generic',
            'filefield_widget' => 'file_generic',
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
        $process = [
            'plugin' => 'sub_process',
            'source' => $field_name,
            'process' => [
                'target_id' => 'fid',
                'display' => 'display',
                'description' => 'description',
            ],
        ];
        $migration->mergeProcessOfProperty($field_name, $process);
    }

}

Classes

Title Deprecated Summary
FileField Plugin annotation @MigrateField( id = "file", core = {7}, source_module = "file", destination_module = "file" )

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.