3 namespace Drupal\migrate_drupal\Plugin;
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6 use Drupal\migrate\Plugin\MigrationInterface;
7 use Drupal\migrate\Row;
10 * Provides an interface for all field type plugins.
12 interface MigrateFieldInterface extends PluginInspectionInterface {
15 * Apply any custom processing to the field migration.
17 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
18 * The migration entity.
20 public function alterFieldMigration(MigrationInterface $migration);
23 * Apply any custom processing to the field instance migration.
25 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
26 * The migration entity.
28 public function alterFieldInstanceMigration(MigrationInterface $migration);
31 * Apply any custom processing to the field widget migration.
33 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
34 * The migration entity.
36 public function alterFieldWidgetMigration(MigrationInterface $migration);
39 * Apply any custom processing to the field formatter migration.
41 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
42 * The migration entity.
44 public function alterFieldFormatterMigration(MigrationInterface $migration);
47 * Get the field formatter type from the source.
49 * @param \Drupal\migrate\Row $row
50 * The field being migrated.
53 * The field formatter type.
55 public function getFieldFormatterType(Row $row);
58 * Get a map between D6 formatters and D8 formatters for this field type.
60 * This is used by static::alterFieldFormatterMigration() in the base class.
63 * The keys are D6 formatters and the values are D8 formatters.
65 public function getFieldFormatterMap();
68 * Get the field widget type from the source.
70 * @param \Drupal\migrate\Row $row
71 * The field being migrated.
74 * The field widget type.
76 public function getFieldWidgetType(Row $row);
79 * Get a map between D6 and D8 widgets for this field type.
82 * The keys are D6 field widget types and the values D8 widgets.
84 public function getFieldWidgetMap();
87 * Apply any custom processing to the field bundle migrations.
89 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
90 * The migration entity.
91 * @param string $field_name
92 * The field name we're processing the value for.
94 * The array of field data from FieldValues::fieldData().
96 public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data);
99 * Computes the destination type of a migrated field.
101 * @param \Drupal\migrate\Row $row
102 * The field being migrated.
105 * The destination field type.
107 public function getFieldType(Row $row);