Reference
C
Class

ApiPlatform\JsonApi\Serializer\CollectionNormalizer

Normalizes collections in the JSON API format.

class ApiPlatform\JsonApi\Serializer\CollectionNormalizer extends ApiPlatform\Serializer\AbstractCollectionNormalizer implements Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface, Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface, Symfony\Component\Serializer\Normalizer\NormalizerInterface
{
    public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
    protected getPaginationData($object, array $context): array
    protected getItemsData($object, null|string $format, array $context): array
    public supportsNormalization($data, null|string $format, array $context): bool
    public hasCacheableSupportsMethod(): bool
    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
    protected initContext(string $resourceClass, array $context): array
    public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer)
}
class ApiPlatform\JsonApi\Serializer\CollectionNormalizer extends ApiPlatform\Serializer\AbstractCollectionNormalizer implements Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface, Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface, Symfony\Component\Serializer\Normalizer\NormalizerInterface
{
    public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
    protected getPaginationData($object, array $context): array
    protected getItemsData($object, null|string $format, array $context): array
    public supportsNormalization($data, null|string $format, array $context): bool
    public hasCacheableSupportsMethod(): bool
    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
    protected initContext(string $resourceClass, array $context): array
    public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer)
}

Properties

resourceClassResolver

ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver
ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver

pageParameterName

string $pageParameterName
string $pageParameterName

resourceMetadataFactory

ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory
ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory

normalizer

Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer
Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer

Methods

__construct

public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)

Parameters

resourceClassResolverApiPlatform\Api\ResourceClassResolverInterface
pageParameterNamestring
resourceMetadataFactoryApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface

getPaginationData

Gets the pagination data.

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

Parameters

object
contextarray

Returns

array

getItemsData

Gets items data.

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

Parameters

object
formatstring
contextarray

Returns

array

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop