/** * Updates an entity with the contents of a row. * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to update. * @param \Drupal\migrate\Row $row * The row object to update from. */ 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()); }
/** * {@inheritdoc} */ public function import(Row $row, array $old_destination_id_values = array()) { foreach ($row->getRawDestination() as $key => $value) { if (isset($value) || !empty($this->configuration['store null'])) { $this->config->set(str_replace(Row::PROPERTY_SEPARATOR, '.', $key), $value); } } $this->config->save(); return [$this->config->getName()]; }
/** * {@inheritdoc} */ public function import(Row $row, array $old_destination_id_values = array()) { if ($row->hasDestinationProperty('langcode')) { $this->config = $this->language_manager->getLanguageConfigOverride($row->getDestinationProperty('langcode'), $this->config->getName()); } foreach ($row->getRawDestination() as $key => $value) { if (isset($value) || !empty($this->configuration['store null'])) { $this->config->set(str_replace(Row::PROPERTY_SEPARATOR, '.', $key), $value); } } $this->config->save(); return [$this->config->getName()]; }