You are here

public function EntityContentBase::import in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php \Drupal\migrate\Plugin\migrate\destination\EntityContentBase::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 MigrateDestinationInterface::import

3 calls to EntityContentBase::import()
EntityComment::import in core/modules/comment/src/Plugin/migrate/destination/EntityComment.php
Import the row.
EntityFile::import in core/modules/file/src/Plugin/migrate/destination/EntityFile.php
Import the row.
EntityUser::import in core/modules/user/src/Plugin/migrate/destination/EntityUser.php
3 methods override EntityContentBase::import()
EntityComment::import in core/modules/comment/src/Plugin/migrate/destination/EntityComment.php
Import the row.
EntityFile::import in core/modules/file/src/Plugin/migrate/destination/EntityFile.php
Import the row.
EntityUser::import in core/modules/user/src/Plugin/migrate/destination/EntityUser.php

File

core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php, line 90
Contains \Drupal\migrate\Plugin\migrate\destination\EntityContentBase.

Class

EntityContentBase
The destination class for all content entities lacking a specific class.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

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