comparison core/modules/migrate_drupal/src/Annotation/MigrateField.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }