Reference
C
Class

ApiPlatform\JsonApi\Serializer\ObjectNormalizer

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

class ApiPlatform\JsonApi\Serializer\ObjectNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface
{
    public __construct(Symfony\Component\Serializer\Normalizer\NormalizerInterface $decorated, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
    public supportsNormalization($data, null|string $format, array $context): bool
    public hasCacheableSupportsMethod(): bool
    public normalize($object, null|string $format, array $context): ArrayObject|array|string|int|float|bool
}
class ApiPlatform\JsonApi\Serializer\ObjectNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface
{
    public __construct(Symfony\Component\Serializer\Normalizer\NormalizerInterface $decorated, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
    public supportsNormalization($data, null|string $format, array $context): bool
    public hasCacheableSupportsMethod(): bool
    public normalize($object, null|string $format, array $context): ArrayObject|array|string|int|float|bool
}

Methods

__construct

public __construct(Symfony\Component\Serializer\Normalizer\NormalizerInterface $decorated, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
public __construct(Symfony\Component\Serializer\Normalizer\NormalizerInterface $decorated, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)

Parameters

decoratedSymfony\Component\Serializer\Normalizer\NormalizerInterface
iriConverterApiPlatform\Api\IriConverterInterface
resourceClassResolverApiPlatform\Api\ResourceClassResolverInterface
resourceMetadataFactoryApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface

supportsNormalization

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

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

Parameters

data
formatstring
contextarray

Returns

bool

hasCacheableSupportsMethod

public hasCacheableSupportsMethod(): bool
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
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

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop