FieldCollectionFieldSettings.php

Namespace

Drupal\paragraphs\Plugin\migrate\process

File

paragraphs/src/Plugin/migrate/process/FieldCollectionFieldSettings.php
View source
<?php

namespace Drupal\paragraphs\Plugin\migrate\process;

use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;

/**
 * Configure field instance settings for paragraphs.
 *
 * @MigrateProcessPlugin(
 *   id = "field_collection_field_settings"
 * )
 */
class FieldCollectionFieldSettings extends ProcessPluginBase {

  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if ($row
      ->getSourceProperty('type') == 'field_collection') {
      $value['target_type'] = 'paragraph';
    }
    return $value;
  }

}

Classes

Namesort descending Description
FieldCollectionFieldSettings Configure field instance settings for paragraphs.