function SchematicNormalizerTrait::doNormalize

Normalizes an object into a set of arrays/scalars.

Parameters

mixed $object: Object to normalize.

string|null $format: Format the normalization result will be encoded as.

array $context: Context options for the normalizer.

Return value

array|string|int|float|bool|\ArrayObject|null The normalization. An \ArrayObject is used to make sure an empty object is encoded as an object not an array.

1 call to SchematicNormalizerTrait::doNormalize()
SchematicNormalizerTrait::normalize in core/modules/serialization/src/Normalizer/SchematicNormalizerTrait.php
10 methods override SchematicNormalizerTrait::doNormalize()
DateTimeNormalizer::doNormalize in core/modules/serialization/src/Normalizer/DateTimeNormalizer.php
Normalizes an object into a set of arrays/scalars.
FieldItemNormalizer::doNormalize in core/modules/jsonapi/src/Normalizer/FieldItemNormalizer.php
This normalizer leaves JSON:API normalizer land and enters the land of Drupal core's serialization system. That system was never designed with cacheability in mind, and hence bubbles cacheability out of band. This must catch it, and pass it to…
FieldNormalizer::doNormalize in core/modules/jsonapi/src/Normalizer/FieldNormalizer.php
Normalizes an object into a set of arrays/scalars.
JsonApiDocumentTopLevelNormalizer::doNormalize in core/modules/jsonapi/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php
Normalizes an object into a set of arrays/scalars.
MarkupNormalizer::doNormalize in core/modules/serialization/src/Normalizer/MarkupNormalizer.php
Normalizes an object into a set of arrays/scalars.

... See full list

File

core/modules/serialization/src/Normalizer/SchematicNormalizerTrait.php, line 48

Class

SchematicNormalizerTrait
Trait for normalizers which can also provide JSON Schema.

Namespace

Drupal\serialization\Normalizer

Code

protected abstract function doNormalize($object, $format = NULL, array $context = []) : array|string|int|float|bool|\ArrayObject|null;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.