You are here

public function FieldCollectionItemNormalizer::normalize in Field collection 8.3

Same name and namespace in other branches
  1. 8 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\Normalizer

Code

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;
}