6a7ff8898b3660262a0337af4cb86ac27efa7660
[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  * )
18  *
19  * This plugin provides the exact same functionality as the Drupal 6 "link"
20  * plugin with the exception that the plugin ID "link_field" is used in the
21  * field type map.
22  *
23  * @deprecated in Drupal 8.3.x, to be removed before Drupal 9.0.x. Use
24  * \Drupal\link\Plugin\migrate\field\d7\LinkField instead.
25  *
26  * @see https://www.drupal.org/node/2751897
27  */
28 class LinkField extends D6LinkField {
29
30   /**
31    * {@inheritdoc}
32    */
33   public function getFieldWidgetMap() {
34     // By default, use the plugin ID for the widget types.
35     return ['link_field' => 'link_default'];
36   }
37
38   /**
39    * {@inheritdoc}
40    */
41   public function processFieldInstance(MigrationInterface $migration) {
42     $process = [
43       'plugin' => 'static_map',
44       'source' => 'settings/title',
45       'bypass' => TRUE,
46       'map' => [
47         'disabled' => DRUPAL_DISABLED,
48         'optional' => DRUPAL_OPTIONAL,
49         'required' => DRUPAL_REQUIRED,
50       ],
51     ];
52     $migration->mergeProcessOfProperty('settings/title', $process);
53   }
54
55 }