You are here

protected function EntityNormalizer::serializeField in JSON:API 8

Serializes a given field.

Parameters

mixed $field: The field to serialize.

array $context: The normalization context.

string $format: The serialization format.

Return value

Value\FieldNormalizerValueInterface The normalized value.

1 call to EntityNormalizer::serializeField()
EntityNormalizer::normalize in src/Normalizer/EntityNormalizer.php
Normalizes an object into a set of arrays/scalars.
1 method overrides EntityNormalizer::serializeField()
ConfigEntityNormalizer::serializeField in src/Normalizer/ConfigEntityNormalizer.php
Serializes a given field.

File

src/Normalizer/EntityNormalizer.php, line 219

Class

EntityNormalizer
Converts the Drupal entity object to a JSON API array structure.

Namespace

Drupal\jsonapi\Normalizer

Code

protected function serializeField($field, array $context, $format) {
  return $this->serializer
    ->normalize($field, $format, $context);
}