TextItemNormalizer.php in Content Synchronization 8.2
File
src/Normalizer/TextItemNormalizer.php
View source
<?php
namespace Drupal\content_sync\Normalizer;
use Drupal\serialization\Normalizer\NormalizerBase;
class TextItemNormalizer extends NormalizerBase {
protected $supportedInterfaceOrClass = 'Drupal\\text\\Plugin\\Field\\FieldType\\TextItemBase';
public function normalize($object, $format = NULL, array $context = []) {
$attributes = [];
foreach ($object
->getProperties(TRUE) as $name => $field) {
$value = $this->serializer
->normalize($field, $format, $context);
if (is_object($value)) {
$value = $this->serializer
->normalize($value, $format, $context);
}
$attributes[$name] = $value;
}
return $attributes;
}
}