Guides
Tutorials
Base collection normalizer.
class ApiPlatform\Serializer\AbstractCollectionNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface, Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface
{
public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
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 getPaginationData(iterable $object, array $context): array
protected getItemsData(iterable $object, null|string $format, array $context): array
protected initContext(string $resourceClass, array $context): array
public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer)
}
class ApiPlatform\Serializer\AbstractCollectionNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface, Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface
{
public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
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 getPaginationData(iterable $object, array $context): array
protected getItemsData(iterable $object, null|string $format, array $context): array
protected initContext(string $resourceClass, array $context): array
public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer)
}
ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver
ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver
string $pageParameterName
string $pageParameterName
ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory
ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory
Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer
Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer
public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
public __construct(ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, string $pageParameterName, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory)
resourceClassResolver | ApiPlatform\Api\ResourceClassResolverInterface | |
pageParameterName | string | |
resourceMetadataFactory | ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface |
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
data | ||
format | string | |
context | array |
bool
public hasCacheableSupportsMethod(): bool
public hasCacheableSupportsMethod(): bool
bool
Normalizes an object into a set of arrays/scalars.
public normalize(null|iterable $object, null|string $format, array $context): ArrayObject|array|string|int|float|bool
public normalize(null|iterable $object, null|string $format, array $context): ArrayObject|array|string|int|float|bool
object | iterable | |
format | string | |
context | array |
ArrayObject
array
string
int
float
bool
Normalizes a raw collection (not API resources).
protected normalizeRawCollection(iterable $object, null|string $format, array $context): ArrayObject|array
protected normalizeRawCollection(iterable $object, null|string $format, array $context): ArrayObject|array
object | iterable | |
format | string | |
context | array |
ArrayObject
array
Gets the pagination configuration.
protected getPaginationConfig(iterable $object, array $context): array
protected getPaginationConfig(iterable $object, array $context): array
object | iterable | |
context | array |
array
protected getOperation(array $context): ApiPlatform\Metadata\Operation
protected getOperation(array $context): ApiPlatform\Metadata\Operation
context | array |
ApiPlatform\Metadata\Operation
Gets the pagination data.
protected getPaginationData(iterable $object, array $context): array
protected getPaginationData(iterable $object, array $context): array
object | iterable | |
context | array |
array
Gets items data.
protected getItemsData(iterable $object, null|string $format, array $context): array
protected getItemsData(iterable $object, null|string $format, array $context): array
object | iterable | |
format | string | |
context | array |
array
Initializes the context.
protected initContext(string $resourceClass, array $context): array
protected initContext(string $resourceClass, array $context): array
resourceClass | string | |
context | array |
array
public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer)
public setNormalizer(Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer)
normalizer | Symfony\Component\Serializer\Normalizer\NormalizerInterface |