You are here

public function EntityNodeType::import in Zircon Profile 8

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

File

core/modules/node/src/Plugin/migrate/destination/EntityNodeType.php, line 23
Contains \Drupal\node\Plugin\migrate\destination\EntityNodeType.

Class

EntityNodeType
Plugin annotation @MigrateDestination( id = "entity:node_type" )

Namespace

Drupal\node\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = array()) {
  $entity_ids = parent::import($row, $old_destination_id_values);
  if ($row
    ->getDestinationProperty('create_body')) {
    $node_type = $this->storage
      ->load(reset($entity_ids));
    node_add_body_field($node_type, $row
      ->getDestinationProperty('create_body_label'));
  }
  return $entity_ids;
}