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