You are here

protected function EntityConfigBase::updateEntity in Zircon Profile 8

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

Updates an entity with the contents of a row.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to update.

\Drupal\migrate\Row $row: The row object to update from.

1 method overrides EntityConfigBase::updateEntity()
EntitySearchPage::updateEntity in core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php
Updates the entity with the contents of a row.

File

core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php, line 77
Contains \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase.

Class

EntityConfigBase
Class for importing configuration entities.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

protected function updateEntity(EntityInterface $entity, Row $row) {
  foreach ($row
    ->getRawDestination() as $property => $value) {
    $this
      ->updateEntityProperty($entity, explode(Row::PROPERTY_SEPARATOR, $property), $value);
  }
  $this
    ->setRollbackAction($row
    ->getIdMap());
}