EntityCommentType.php

Same filename in other branches
  1. 9 core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php
  2. 8.9.x core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php
  3. 10 core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php

Namespace

Drupal\comment\Plugin\migrate\destination

File

core/modules/comment/src/Plugin/migrate/destination/EntityCommentType.php

View source
<?php

namespace Drupal\comment\Plugin\migrate\destination;

use Drupal\migrate\Attribute\MigrateDestination;
use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;
use Drupal\migrate\Row;

/**
 * Comment type destination.
 */
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;
    }

}

Classes

Title Deprecated Summary
EntityCommentType Comment type destination.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.