function ListNormalizer::normalize
Same name in other branches
- 8.9.x core/modules/serialization/src/Normalizer/ListNormalizer.php \Drupal\serialization\Normalizer\ListNormalizer::normalize()
- 10 core/modules/serialization/src/Normalizer/ListNormalizer.php \Drupal\serialization\Normalizer\ListNormalizer::normalize()
- 11.x core/modules/serialization/src/Normalizer/ListNormalizer.php \Drupal\serialization\Normalizer\ListNormalizer::normalize()
1 method overrides ListNormalizer::normalize()
- FieldNormalizer::normalize in core/
modules/ hal/ src/ Normalizer/ FieldNormalizer.php
File
-
core/
modules/ serialization/ src/ Normalizer/ ListNormalizer.php, line 26
Class
- ListNormalizer
- Converts list objects to arrays.
Namespace
Drupal\serialization\NormalizerCode
public function normalize($object, $format = NULL, array $context = []) {
$attributes = [];
foreach ($object as $fieldItem) {
$attributes[] = $this->serializer
->normalize($fieldItem, $format, $context);
}
return $attributes;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.