a796409662f30921f167deaa5977d455c3b3aaaa
[yaffs-website] / web / core / modules / link / src / Plugin / migrate / cckfield / d7 / LinkField.php
1 <?php
2
3 namespace Drupal\link\Plugin\migrate\cckfield\d7;
4
5 @trigger_error('LinkField is deprecated in Drupal 8.3.x and will be be removed before Drupal 9.0.x. Use \Drupal\link\Plugin\migrate\field\d7\LinkField instead.', E_USER_DEPRECATED);
6
7 use Drupal\link\Plugin\migrate\cckfield\LinkField as D6LinkField;
8 use Drupal\migrate\Plugin\MigrationInterface;
9
10 /**
11  * @MigrateCckField(
12  *   id = "link_field",
13  *   core = {7},
14  *   type_map = {
15  *     "link_field" = "link"
16  *   },
17  *   source_module = "link",
18  *   destination_module = "link"
19  * )
20  *
21  * This plugin provides the exact same functionality as the Drupal 6 "link"
22  * plugin with the exception that the plugin ID "link_field" is used in the
23  * field type map.
24  *
25  * @deprecated in Drupal 8.3.x, to be removed before Drupal 9.0.x. Use
26  * \Drupal\link\Plugin\migrate\field\d7\LinkField instead.
27  *
28  * @see https://www.drupal.org/node/2751897
29  */
30 class LinkField extends D6LinkField {
31
32   /**
33    * {@inheritdoc}
34    */
35   public function getFieldWidgetMap() {
36     // By default, use the plugin ID for the widget types.
37     return ['link_field' => 'link_default'];
38   }
39
40   /**
41    * @inheritdoc}
42    */
43   public function alterFieldInstanceMigration(MigrationInterface $migration) {
44     $process = [
45       'plugin' => 'static_map',
46       'source' => 'settings/title',
47       'bypass' => TRUE,
48       'map' => [
49         'disabled' => DRUPAL_DISABLED,
50         'optional' => DRUPAL_OPTIONAL,
51         'required' => DRUPAL_REQUIRED,
52       ],
53     ];
54     $migration->mergeProcessOfProperty('settings/title', $process);
55   }
56
57 }