Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / link / src / Plugin / migrate / field / d7 / LinkField.php
1 <?php
2
3 namespace Drupal\link\Plugin\migrate\field\d7;
4
5 use Drupal\link\Plugin\migrate\field\d6\LinkField as D6LinkField;
6 use Drupal\migrate\Plugin\MigrationInterface;
7
8 /**
9  * @MigrateField(
10  *   id = "link_field",
11  *   core = {7},
12  *   type_map = {
13  *     "link_field" = "link"
14  *   }
15  * )
16  *
17  * This plugin provides the exact same functionality as the Drupal 6 "link"
18  * plugin with the exception that the plugin ID "link_field" is used in the
19  * field type map.
20  */
21 class LinkField extends D6LinkField {
22
23   /**
24    * {@inheritdoc}
25    */
26   public function getFieldWidgetMap() {
27     // By default, use the plugin ID for the widget types.
28     return ['link_field' => 'link_default'];
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function processFieldInstance(MigrationInterface $migration) {
35     $process = [
36       'plugin' => 'static_map',
37       'source' => 'settings/title',
38       'bypass' => TRUE,
39       'map' => [
40         'disabled' => DRUPAL_DISABLED,
41         'optional' => DRUPAL_OPTIONAL,
42         'required' => DRUPAL_REQUIRED,
43       ],
44     ];
45     $migration->mergeProcessOfProperty('settings/title', $process);
46   }
47
48 }