DefaultTypeProcessor.php in Content Synchronizer 3.x
File
src/Processors/Type/DefaultTypeProcessor.php
View source
<?php
namespace Drupal\content_synchronizer\Processors\Type;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\TypedData\TypedData;
class DefaultTypeProcessor implements TypeProcessorInterface {
public function getPluginId() {
return 'type_processor_default';
}
public function getPluginDefinition() {
return [];
}
public function getExportedData(TypedData $propertyData) {
$data = [];
foreach ($propertyData as $value) {
$data[] = $value
->getValue();
}
return $data;
}
public function initImportedEntity(EntityInterface $entityToImport, $propertyId, array $data) {
$entityToImport
->set($propertyId, $data[$propertyId]);
}
}