protected function Paragraphs::paragraphAlterFieldWidgetMigration

Adds processes for paragraphs field widgets.

Parameters

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration.

1 call to Paragraphs::paragraphAlterFieldWidgetMigration()
Paragraphs::alterFieldWidgetMigration in paragraphs/src/Plugin/migrate/field/Paragraphs.php

File

paragraphs/src/Plugin/migrate/field/Paragraphs.php, line 170

Class

Paragraphs
Field Plugin for paragraphs migrations.

Namespace

Drupal\paragraphs\Plugin\migrate\field

Code

protected function paragraphAlterFieldWidgetMigration(MigrationInterface $migration) {
  $title = [
    'paragraphs' => [
      'plugin' => 'paragraphs_process_on_value',
      'source_value' => 'type',
      'expected_value' => 'paragraphs',
      'process' => [
        'plugin' => 'get',
        'source' => 'settings/title',
      ],
    ],
  ];
  $title_plural = [
    'paragraphs' => [
      'plugin' => 'paragraphs_process_on_value',
      'source_value' => 'type',
      'expected_value' => 'paragraphs',
      'process' => [
        'plugin' => 'get',
        'source' => 'settings/title_multiple',
      ],
    ],
  ];
  $edit_mode = [
    'paragraphs' => [
      'plugin' => 'paragraphs_process_on_value',
      'source_value' => 'type',
      'expected_value' => 'paragraphs',
      'process' => [
        'plugin' => 'get',
        'source' => 'settings/default_edit_mode',
      ],
    ],
  ];
  $add_mode = [
    'paragraphs' => [
      'plugin' => 'paragraphs_process_on_value',
      'source_value' => 'type',
      'expected_value' => 'paragraphs',
      'process' => [
        'plugin' => 'get',
        'source' => 'settings/add_mode',
      ],
    ],
  ];
  $migration
    ->mergeProcessOfProperty('options/settings/title', $title);
  $migration
    ->mergeProcessOfProperty('options/settings/title_plural', $title_plural);
  $migration
    ->mergeProcessOfProperty('options/settings/edit_mode', $edit_mode);
  $migration
    ->mergeProcessOfProperty('options/settings/add_mode', $add_mode);
}