You are here

public function EntityComment::import in Zircon Profile 8

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

Import the row.

Derived classes must implement import(), to construct one new object (pre-populated) using ID mappings in the Migration.

Parameters

\Drupal\migrate\Row $row: The row object.

array $old_destination_id_values: The old destination ids.

Return value

mixed The entity id or an indication of success.

Overrides EntityContentBase::import

File

core/modules/comment/src/Plugin/migrate/destination/EntityComment.php, line 101
Contains \Drupal\comment\Plugin\migrate\destination\EntityComment.

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 = array()) {
  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;
}