8225b713f70b0097ea952688df6915378e1ba3da
[yaffs-website] / web / core / modules / migrate_drupal / src / Annotation / MigrateField.php
1 <?php
2
3 namespace Drupal\migrate_drupal\Annotation;
4
5 use Drupal\Component\Annotation\Plugin;
6
7 /**
8  * Defines a field plugin annotation object.
9  *
10  * Field plugins are responsible for handling the migration of custom fields
11  * (provided by CCK in Drupal 6 and Field API in Drupal 7) to Drupal 8. They are
12  * allowed to alter fieldable entity migrations when these migrations are being
13  * generated, and can compute destination field types for individual fields
14  * during the actual migration process.
15  *
16  * Plugin Namespace: Plugin\migrate\field
17  *
18  * @Annotation
19  */
20 class MigrateField extends Plugin {
21
22   /**
23    * @inheritdoc
24    */
25   public function __construct($values) {
26     parent::__construct($values);
27     // Provide default value for core property, in case it's missing.
28     if (empty($this->definition['core'])) {
29       $this->definition['core'] = [6];
30     }
31   }
32
33   /**
34    * The plugin ID.
35    *
36    * @var string
37    */
38   public $id;
39
40   /**
41    * Map of D6 and D7 field types to D8 field type plugin IDs.
42    *
43    * @var string[]
44    */
45   public $type_map = [];
46
47   /**
48    * The Drupal core version(s) this plugin applies to.
49    *
50    * @var int[]
51    */
52   public $core;
53
54   /**
55    * Identifies the system providing the data the field plugin will read.
56    *
57    * The source_module is expected to be the name of a Drupal module that must
58    * must be installed in the source database.
59    *
60    * @var string
61    */
62   public $source_module;
63
64   /**
65    * Identifies the system handling the data the destination plugin will write.
66    *
67    * The destination_module is expected to be the name of a Drupal module on the
68    * destination site that must be installed.
69    *
70    * @var string
71    */
72   public $destination_module;
73
74 }