public function FieldCollectionItemNormalizer::normalize in Field collection 8
Same name and namespace in other branches
- 8.3 src/Normalizer/FieldCollectionItemNormalizer.php \Drupal\field_collection\Normalizer\FieldCollectionItemNormalizer::normalize()
Overrides ComplexDataNormalizer::normalize
File
- src/
Normalizer/ FieldCollectionItemNormalizer.php, line 23
Class
- FieldCollectionItemNormalizer
- Adds field collection items to field collections.
Namespace
Drupal\field_collection\NormalizerCode
public function normalize($field_item, $format = NULL, array $context = []) {
// Set the normalized field output to the field collection item.
$values = $this->serializer
->normalize($field_item
->getFieldCollectionItem(), $format, $context);
return $values;
}