public function TextItemNormalizer::normalize in Content Synchronization 8.2
Same name and namespace in other branches
- 3.0.x src/Normalizer/TextItemNormalizer.php \Drupal\content_sync\Normalizer\TextItemNormalizer::normalize()
File
- src/
Normalizer/ TextItemNormalizer.php, line 22
Class
- TextItemNormalizer
- Converts TextItem fields to an array including computed values.
Namespace
Drupal\content_sync\NormalizerCode
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;
}