Version 1
[yaffs-website] / web / core / modules / migrate_drupal / src / Plugin / MigrateFieldInterface.php
1 <?php
2
3 namespace Drupal\migrate_drupal\Plugin;
4
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6 use Drupal\migrate\Plugin\MigrationInterface;
7 use Drupal\migrate\Row;
8
9 /**
10  * Provides an interface for all field type plugins.
11  */
12 interface MigrateFieldInterface extends PluginInspectionInterface {
13
14   /**
15    * Apply any custom processing to the field migration.
16    *
17    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
18    *   The migration entity.
19    */
20   public function processField(MigrationInterface $migration);
21
22   /**
23    * Apply any custom processing to the field instance migration.
24    *
25    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
26    *   The migration entity.
27    */
28   public function processFieldInstance(MigrationInterface $migration);
29
30   /**
31    * Apply any custom processing to the field widget migration.
32    *
33    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
34    *   The migration entity.
35    */
36   public function processFieldWidget(MigrationInterface $migration);
37
38   /**
39    * Apply any custom processing to the field formatter migration.
40    *
41    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
42    *   The migration entity.
43    */
44   public function processFieldFormatter(MigrationInterface $migration);
45
46   /**
47    * Get a map between D6 formatters and D8 formatters for this field type.
48    *
49    * This is used by static::processFieldFormatter() in the base class.
50    *
51    * @return array
52    *   The keys are D6 formatters and the values are D8 formatters.
53    */
54   public function getFieldFormatterMap();
55
56   /**
57    * Get a map between D6 and D8 widgets for this field type.
58    *
59    * @return array
60    *   The keys are D6 field widget types and the values D8 widgets.
61    */
62   public function getFieldWidgetMap();
63
64   /**
65    * Apply any custom processing to the field bundle migrations.
66    *
67    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
68    *   The migration entity.
69    * @param string $field_name
70    *   The field name we're processing the value for.
71    * @param array $data
72    *   The array of field data from FieldValues::fieldData().
73    */
74   public function processFieldValues(MigrationInterface $migration, $field_name, $data);
75
76   /**
77    * Computes the destination type of a migrated field.
78    *
79    * @param \Drupal\migrate\Row $row
80    *   The field being migrated.
81    *
82    * @return string
83    *   The destination field type.
84    */
85   public function getFieldType(Row $row);
86
87 }