function Book::updateEntity
Updates an entity with the new values from row.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to update.
\Drupal\migrate\Row $row: The row object to update from.
Return value
\Drupal\Core\Entity\EntityInterface An updated entity from row values.
Overrides EntityContentBase::updateEntity
File
- 
              core/
modules/ book/ src/ Plugin/ migrate/ destination/ Book.php, line 27  
Class
- Book
 - Plugin annotation @MigrateDestination( id = "book", provider = "book" )
 
Namespace
Drupal\book\Plugin\migrate\destinationCode
protected function updateEntity(EntityInterface $entity, Row $row) {
  if ($entity->book) {
    $book = $row->getDestinationProperty('book');
    foreach ($book as $key => $value) {
      $entity->book[$key] = $value;
    }
  }
  else {
    $entity->book = $row->getDestinationProperty('book');
  }
  return parent::updateEntity($entity, $row);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.