ParagraphProcessor.php in Content Synchronizer 3.x
File
src/Plugin/content_synchronizer/entity_processor/ParagraphProcessor.php
View source
<?php
namespace Drupal\content_synchronizer\Plugin\content_synchronizer\entity_processor;
use Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase;
use Drupal\Core\Entity\EntityInterface;
use Drupal\paragraphs\Entity\Paragraph;
class ParagraphProcessor extends EntityProcessorBase {
public function getEntityToImport(array $data, EntityInterface $existingEntity = NULL) {
if (is_null($existingEntity)) {
$existingEntity = Paragraph::create([
'type' => $this
->getDefaultLanguageData($data)['type'],
]);
}
return parent::getEntityToImport($data, $existingEntity);
}
}