annotate 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
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\migrate_drupal\Annotation;
Chris@0 4
Chris@0 5 use Drupal\Component\Annotation\Plugin;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Defines a field plugin annotation object.
Chris@0 9 *
Chris@0 10 * Field plugins are responsible for handling the migration of custom fields
Chris@0 11 * (provided by CCK in Drupal 6 and Field API in Drupal 7) to Drupal 8. They are
Chris@0 12 * allowed to alter fieldable entity migrations when these migrations are being
Chris@0 13 * generated, and can compute destination field types for individual fields
Chris@0 14 * during the actual migration process.
Chris@0 15 *
Chris@0 16 * Plugin Namespace: Plugin\migrate\field
Chris@0 17 *
Chris@0 18 * @Annotation
Chris@0 19 */
Chris@0 20 class MigrateField extends Plugin {
Chris@0 21
Chris@0 22 /**
Chris@0 23 * @inheritdoc
Chris@0 24 */
Chris@0 25 public function __construct($values) {
Chris@0 26 parent::__construct($values);
Chris@0 27 // Provide default value for core property, in case it's missing.
Chris@0 28 if (empty($this->definition['core'])) {
Chris@0 29 $this->definition['core'] = [6];
Chris@0 30 }
Chris@0 31 }
Chris@0 32
Chris@0 33 /**
Chris@0 34 * The plugin ID.
Chris@0 35 *
Chris@0 36 * @var string
Chris@0 37 */
Chris@0 38 public $id;
Chris@0 39
Chris@0 40 /**
Chris@0 41 * Map of D6 and D7 field types to D8 field type plugin IDs.
Chris@0 42 *
Chris@0 43 * @var string[]
Chris@0 44 */
Chris@0 45 public $type_map = [];
Chris@0 46
Chris@0 47 /**
Chris@0 48 * The Drupal core version(s) this plugin applies to.
Chris@0 49 *
Chris@0 50 * @var int[]
Chris@0 51 */
Chris@0 52 public $core = [];
Chris@0 53
Chris@0 54 }