References CollectionNormalizer
Reference
C
Class

ApiPlatform\Hydra\Serializer\CollectionNormalizer

This normalizer handles collections.

class ApiPlatform\Hydra\Serializer\CollectionNormalizer extends implements `<a href="/docs/main/references/Serializer/CacheableSupportsMethodInterface">ApiPlatform\Serializer\CacheableSupportsMethodInterface, Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface, Symfony\Component\Serializer\Normalizer\NormalizerInterface
{
    public __construct($contextBuilder, `<a href="/docs/main/references/Api/ResourceClassResolverInterface">ApiPlatform\Api\ResourceClassResolverInterface</a>`|`<a href="/docs/main/references/Api/ResourceClassResolverInterface">ApiPlatform\Metadata\ResourceClassResolverInterface</a>` $resourceClassResolver, `<a href="/docs/main/references/Api/IriConverterInterface">ApiPlatform\Api\IriConverterInterface</a>`|`<a href="/docs/main/references/Api/IriConverterInterface">ApiPlatform\Metadata\IriConverterInterface</a>` $iriConverter, null|`<a href="/docs/main/references/Metadata/Resource/Factory/ResourceMetadataCollectionFactoryInterface">ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, array $defaultContext)
    protected getPaginationData(iterable $object, array $context): array
    protected getItemsData(iterable $object, null|string $format, array $context): array
    protected initContext(string $resourceClass, array $context): array
    public supportsNormalization($data, null|string $format, array $context): bool
    public hasCacheableSupportsMethod(): bool
    public getSupportedTypes(null|string $format): array
    public normalize(null|iterable $object, null|string $format, array $context): ArrayObject|array|string|int|float|bool
    protected normalizeRawCollection(iterable $object, null|string $format, array $context): ArrayObject|array
    protected getPaginationConfig(iterable $object, array $context): array
    protected getOperation(array $context): ApiPlatform\Metadata\Operation
    public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer): null
    protected createOperationContext(array $context, null|string $resourceClass): array
}

Properties

resourceMetadataCollectionFactory

resourceClassResolver

pageParameterName

string $pageParameterName

resourceMetadataFactory

normalizer

Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer

Methods

__construct

Parameters

contextBuilder`ApiPlatform\JsonLd\ContextBuilderInterface`
resourceClassResolver`ApiPlatform\Api\ResourceClassResolverInterface`
`ApiPlatform\Metadata\ResourceClassResolverInterface`
iriConverter`ApiPlatform\Api\IriConverterInterface`
`ApiPlatform\Metadata\IriConverterInterface`
resourceMetadataCollectionFactory`ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface`
defaultContextarray

getPaginationData

Gets the pagination data.

protected getPaginationData(iterable $object, array $context): array

Parameters

objectiterable
contextarray

Returns

array

getItemsData

Gets items data.

protected getItemsData(iterable $object, null|string $format, array $context): array

Parameters

objectiterable
formatstring
contextarray

Returns

array

initContext

protected initContext(string $resourceClass, array $context): array

Parameters

resourceClassstring
contextarray

Returns

array

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