You are here

public function EntityComment::import in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/migrate/destination/EntityComment.php \Drupal\comment\Plugin\migrate\destination\EntityComment::import()

Throws

\Drupal\migrate\MigrateException When an entity cannot be looked up.

\Drupal\migrate\Exception\EntityValidationException When an entity validation hasn't been passed.

Overrides EntityContentBase::import

File

core/modules/comment/src/Plugin/migrate/destination/EntityComment.php, line 83

Class

EntityComment
Plugin annotation @MigrateDestination( id = "entity:comment" )

Namespace

Drupal\comment\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = []) {
  if ($row
    ->isStub() && ($state = $this->state
    ->get('comment.maintain_entity_statistics', 0))) {
    $this->state
      ->set('comment.maintain_entity_statistics', 0);
  }
  $return = parent::import($row, $old_destination_id_values);
  if ($row
    ->isStub() && $state) {
    $this->state
      ->set('comment.maintain_entity_statistics', $state);
  }
  return $return;
}