Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\migrate_drupal\Plugin;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Component\Plugin\PluginInspectionInterface;
|
Chris@0
|
6 use Drupal\migrate\Plugin\MigrationInterface;
|
Chris@0
|
7 use Drupal\migrate\Row;
|
Chris@0
|
8
|
Chris@0
|
9 /**
|
Chris@0
|
10 * Provides an interface for all field type plugins.
|
Chris@0
|
11 */
|
Chris@0
|
12 interface MigrateFieldInterface extends PluginInspectionInterface {
|
Chris@0
|
13
|
Chris@0
|
14 /**
|
Chris@0
|
15 * Apply any custom processing to the field migration.
|
Chris@0
|
16 *
|
Chris@0
|
17 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
Chris@0
|
18 * The migration entity.
|
Chris@0
|
19 */
|
Chris@17
|
20 public function alterFieldMigration(MigrationInterface $migration);
|
Chris@0
|
21
|
Chris@0
|
22 /**
|
Chris@0
|
23 * Apply any custom processing to the field instance migration.
|
Chris@0
|
24 *
|
Chris@0
|
25 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
Chris@0
|
26 * The migration entity.
|
Chris@0
|
27 */
|
Chris@17
|
28 public function alterFieldInstanceMigration(MigrationInterface $migration);
|
Chris@0
|
29
|
Chris@0
|
30 /**
|
Chris@0
|
31 * Apply any custom processing to the field widget migration.
|
Chris@0
|
32 *
|
Chris@0
|
33 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
Chris@0
|
34 * The migration entity.
|
Chris@0
|
35 */
|
Chris@17
|
36 public function alterFieldWidgetMigration(MigrationInterface $migration);
|
Chris@0
|
37
|
Chris@0
|
38 /**
|
Chris@0
|
39 * Apply any custom processing to the field formatter migration.
|
Chris@0
|
40 *
|
Chris@0
|
41 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
Chris@0
|
42 * The migration entity.
|
Chris@0
|
43 */
|
Chris@17
|
44 public function alterFieldFormatterMigration(MigrationInterface $migration);
|
Chris@0
|
45
|
Chris@0
|
46 /**
|
Chris@0
|
47 * Get the field formatter type from the source.
|
Chris@0
|
48 *
|
Chris@0
|
49 * @param \Drupal\migrate\Row $row
|
Chris@0
|
50 * The field being migrated.
|
Chris@0
|
51 *
|
Chris@0
|
52 * @return string
|
Chris@0
|
53 * The field formatter type.
|
Chris@0
|
54 */
|
Chris@0
|
55 public function getFieldFormatterType(Row $row);
|
Chris@0
|
56
|
Chris@0
|
57 /**
|
Chris@0
|
58 * Get a map between D6 formatters and D8 formatters for this field type.
|
Chris@0
|
59 *
|
Chris@17
|
60 * This is used by static::alterFieldFormatterMigration() in the base class.
|
Chris@0
|
61 *
|
Chris@0
|
62 * @return array
|
Chris@0
|
63 * The keys are D6 formatters and the values are D8 formatters.
|
Chris@0
|
64 */
|
Chris@0
|
65 public function getFieldFormatterMap();
|
Chris@0
|
66
|
Chris@0
|
67 /**
|
Chris@0
|
68 * Get the field widget type from the source.
|
Chris@0
|
69 *
|
Chris@0
|
70 * @param \Drupal\migrate\Row $row
|
Chris@0
|
71 * The field being migrated.
|
Chris@0
|
72 *
|
Chris@0
|
73 * @return string
|
Chris@0
|
74 * The field widget type.
|
Chris@0
|
75 */
|
Chris@0
|
76 public function getFieldWidgetType(Row $row);
|
Chris@0
|
77
|
Chris@0
|
78 /**
|
Chris@0
|
79 * Get a map between D6 and D8 widgets for this field type.
|
Chris@0
|
80 *
|
Chris@0
|
81 * @return array
|
Chris@0
|
82 * The keys are D6 field widget types and the values D8 widgets.
|
Chris@0
|
83 */
|
Chris@0
|
84 public function getFieldWidgetMap();
|
Chris@0
|
85
|
Chris@0
|
86 /**
|
Chris@0
|
87 * Apply any custom processing to the field bundle migrations.
|
Chris@0
|
88 *
|
Chris@0
|
89 * @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
Chris@0
|
90 * The migration entity.
|
Chris@0
|
91 * @param string $field_name
|
Chris@0
|
92 * The field name we're processing the value for.
|
Chris@0
|
93 * @param array $data
|
Chris@0
|
94 * The array of field data from FieldValues::fieldData().
|
Chris@0
|
95 */
|
Chris@17
|
96 public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data);
|
Chris@0
|
97
|
Chris@0
|
98 /**
|
Chris@0
|
99 * Computes the destination type of a migrated field.
|
Chris@0
|
100 *
|
Chris@0
|
101 * @param \Drupal\migrate\Row $row
|
Chris@0
|
102 * The field being migrated.
|
Chris@0
|
103 *
|
Chris@0
|
104 * @return string
|
Chris@0
|
105 * The destination field type.
|
Chris@0
|
106 */
|
Chris@0
|
107 public function getFieldType(Row $row);
|
Chris@0
|
108
|
Chris@0
|
109 }
|