You are here

public function EntityContentBase::import in Multiversion 8

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

src/Plugin/migrate/destination/EntityContentBase.php, line 85

Class

EntityContentBase
Migration destination class for content entities.

Namespace

Drupal\multiversion\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = []) {
  $this->rollbackAction = MigrateIdMapInterface::ROLLBACK_DELETE;
  $entity = $this
    ->getEntity($row, $old_destination_id_values);
  if (!$entity) {
    throw new MigrateException('Unable to get entity');
  }
  $ids = $this
    ->save($entity, $old_destination_id_values);
  if ($this
    ->isTranslationDestination()) {
    $ids[] = $entity
      ->language()
      ->getId();
  }
  return $ids;
}