You are here

public function DynamicEntityReferenceItemNormalizer::normalize in Dynamic Entity Reference 8

Same name and namespace in other branches
  1. 8.2 src/Normalizer/DynamicEntityReferenceItemNormalizer.php \Drupal\dynamic_entity_reference\Normalizer\DynamicEntityReferenceItemNormalizer::normalize()

Overrides EntityReferenceItemNormalizer::normalize

File

src/Normalizer/DynamicEntityReferenceItemNormalizer.php, line 23

Class

DynamicEntityReferenceItemNormalizer
Dynamic entity reference normalizer.

Namespace

Drupal\dynamic_entity_reference\Normalizer

Code

public function normalize($field_item, $format = NULL, array $context = []) {
  $normalized = parent::normalize($field_item, $format, $context);
  $normalized['target_type'] = $field_item->target_type;
  return $normalized;
}