Version 1
[yaffs-website] / web / core / modules / comment / src / Plugin / migrate / destination / EntityCommentType.php
diff --git a/web/core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php b/web/core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php
new file mode 100644 (file)
index 0000000..9bee87a
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\comment\Plugin\migrate\destination;
+
+use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;
+use Drupal\migrate\Row;
+
+/**
+ * @MigrateDestination(
+ *   id = "entity:comment_type"
+ * )
+ */
+class EntityCommentType extends EntityConfigBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function import(Row $row, array $old_destination_id_values = []) {
+    $entity_ids = parent::import($row, $old_destination_id_values);
+    \Drupal::service('comment.manager')->addBodyField(reset($entity_ids));
+    return $entity_ids;
+  }
+
+}