public function NodeProcessor::getEntityToImport in Content Synchronizer 8
Return the entity to import.
Parameters
array $data: The data to import.
\Drupal\Core\Entity\Entity $entityToImport: The existing entity to update.
Overrides EntityProcessorBase::getEntityToImport
File
- src/
Plugin/ content_synchronizer/ entity_processor/ NodeProcessor.php, line 22
Class
- NodeProcessor
- Plugin implementation of the 'accordion' formatter.
Namespace
Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processorCode
public function getEntityToImport(array $data, Entity $existingEntity = NULL) {
if (is_null($existingEntity)) {
$existingEntity = Node::create([
'type' => $this
->getDefaultLanguageData($data)['type'],
]);
}
return parent::getEntityToImport($data, $existingEntity);
}