References ObjectNormalizer
Reference
C
Class

ApiPlatform\GraphQl\Serializer\ObjectNormalizer

Decorates the output with GraphQL metadata when appropriate, but otherwise just passes through to the decorated normalizer.

class ApiPlatform\GraphQl\Serializer\ObjectNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, ApiPlatform\Serializer\CacheableSupportsMethodInterface
{
    public __construct(Symfony\Component\Serializer\Normalizer\NormalizerInterface $decorated, |`<a href="/docs/main/references/Api/IriConverterInterface">ApiPlatform\Api\IriConverterInterface</a>` $iriConverter, `<a href="/docs/main/references/Api/IdentifiersExtractorInterface">ApiPlatform\Metadata\IdentifiersExtractorInterface</a>`|`<a href="/docs/main/references/Api/IdentifiersExtractorInterface">ApiPlatform\Api\IdentifiersExtractorInterface $identifiersExtractor)
    public supportsNormalization($data, null|string $format, array $context): bool
    public getSupportedTypes($format): array
    public hasCacheableSupportsMethod(): bool
    public normalize($object, null|string $format, array $context): ArrayObject|array|string|int|float|bool
}

Methods

__construct

Parameters

decoratedSymfony\Component\Serializer\Normalizer\NormalizerInterface
iriConverter`ApiPlatform\Metadata\IriConverterInterface`
`ApiPlatform\Api\IriConverterInterface`
identifiersExtractor`ApiPlatform\Metadata\IdentifiersExtractorInterface`
`ApiPlatform\Api\IdentifiersExtractorInterface`

supportsNormalization

Checks whether the given class is supported for normalization by this normalizer.

public supportsNormalization($data, null|string $format, array $context): bool

Parameters

data
formatstring
contextarray

Returns

bool

getSupportedTypes

public getSupportedTypes($format): array

Parameters

format

Returns

array

hasCacheableSupportsMethod

public hasCacheableSupportsMethod(): bool

Returns

bool

normalize

Normalizes an object into a set of arrays/scalars.

public normalize($object, null|string $format, array $context): ArrayObject|array|string|int|float|bool

Parameters

object
formatstring
contextarray

Returns

ArrayObject
array
string
int
float
bool

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop