Reference
C
Class

ApiPlatform\GraphQl\Serializer\ItemNormalizer

GraphQL normalizer.

class ApiPlatform\GraphQl\Serializer\ItemNormalizer extends ApiPlatform\Serializer\ItemNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, Symfony\Component\Serializer\Normalizer\DenormalizerInterface, Symfony\Component\Serializer\SerializerAwareInterface, Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface
{
    public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\IdentifiersExtractorInterface $identifiersExtractor, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, null|Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor, null|Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter, null|Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory, null|Psr\Log\LoggerInterface $logger, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker)
    public supportsNormalization($data, null|string $format, array $context): bool
    public normalize($object, null|string $format, array<string> $context): ArrayObject|array|string|int|float|bool
    protected normalizeCollectionOfRelations(ApiPlatform\Metadata\ApiProperty $propertyMetadata, iterable $attributeValue, string $resourceClass, null|string $format, array $context): array
    public supportsDenormalization($data, string $type, null|string $format, array $context): bool
    protected getAllowedAttributes(object|string $classOrObject, array $context, bool $attributesAsString): array|bool
    protected setAttributeValue($object, $attribute, $value, $format, array $context): null
    public denormalize($data, string $class, null|string $format, array $context)
    public hasCacheableSupportsMethod(): bool
    protected instantiateObject(array $data, string $class, array $context, ReflectionClass $reflectionClass, array|bool $allowedAttributes, null|string $format): object
    protected getClassDiscriminatorResolvedClass(array $data, string $class, array $context): string
    protected createConstructorArgument($parameterData, string $key, ReflectionParameter $constructorParameter, array $context, null|string $format)
    protected extractAttributes($object, $format, array $context): array<int, string>
    protected isAllowedAttribute(object|string $classOrObject, string $attribute, null|string $format, array $context): bool
    protected canAccessAttribute(null|object $object, string $attribute, array $context): bool
    protected canAccessAttributePostDenormalize(null|object $object, null|object $previousObject, string $attribute, array $context): bool
    protected validateType(string $attribute, Symfony\Component\PropertyInfo\Type $type, $value, null|string $format, array $context): null
    protected denormalizeCollection(string $attribute, ApiPlatform\Metadata\ApiProperty $propertyMetadata, Symfony\Component\PropertyInfo\Type $type, string $className, $value, null|string $format, array $context): array
    protected denormalizeRelation(string $attributeName, ApiPlatform\Metadata\ApiProperty $propertyMetadata, string $className, $value, null|string $format, array $context): object
    protected getFactoryOptions(array $context): array
    protected getAttributeValue(object $object, string $attribute, null|string $format, array $context)
    protected normalizeRelation(ApiPlatform\Metadata\ApiProperty $propertyMetadata, null|object $relatedObject, string $resourceClass, null|string $format, array $context): ArrayObject|array|string
    protected getAttributes(object $object, null|string $format, array $context): array<int, string>
    protected denormalizeParameter(ReflectionClass $class, ReflectionParameter $parameter, string $parameterName, $parameterData, array $context, null|string $format)
    protected createChildContext(array $parentContext, string $attribute, null|string $format): array
    protected isCircularReference(object $object, array $context): bool
    protected handleCircularReference(object $object, null|string $format, array $context)
    protected getGroups(array $context): array
    protected prepareForDenormalization($data): array
    protected getConstructor(array $data, string $class, array $context, ReflectionClass $reflectionClass, array|bool $allowedAttributes): ReflectionMethod
    protected validateCallbackContext(array $context, string $contextType): null
    protected applyCallbacks($value, object|string $object, string $attribute, null|string $format, array $context)
    protected getAttributeNormalizationContext(object $object, string $attribute, array $context): array
    protected getAttributeDenormalizationContext(string $class, string $attribute, array $context): array
    protected getAttributeMetadata(object|string $objectOrClass, string $attribute): Symfony\Component\Serializer\Mapping\AttributeMetadataInterface
    protected extractObjectToPopulate(string $class, array $context, null|string $key): object
    public setSerializer(Symfony\Component\Serializer\SerializerInterface $serializer)
    protected getInputClass(array $context): string
    protected getOutputClass(array $context): string
}
class ApiPlatform\GraphQl\Serializer\ItemNormalizer extends ApiPlatform\Serializer\ItemNormalizer implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, Symfony\Component\Serializer\Normalizer\DenormalizerInterface, Symfony\Component\Serializer\SerializerAwareInterface, Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface
{
    public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\IdentifiersExtractorInterface $identifiersExtractor, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, null|Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor, null|Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter, null|Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory, null|Psr\Log\LoggerInterface $logger, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker)
    public supportsNormalization($data, null|string $format, array $context): bool
    public normalize($object, null|string $format, array<string> $context): ArrayObject|array|string|int|float|bool
    protected normalizeCollectionOfRelations(ApiPlatform\Metadata\ApiProperty $propertyMetadata, iterable $attributeValue, string $resourceClass, null|string $format, array $context): array
    public supportsDenormalization($data, string $type, null|string $format, array $context): bool
    protected getAllowedAttributes(object|string $classOrObject, array $context, bool $attributesAsString): array|bool
    protected setAttributeValue($object, $attribute, $value, $format, array $context): null
    public denormalize($data, string $class, null|string $format, array $context)
    public hasCacheableSupportsMethod(): bool
    protected instantiateObject(array $data, string $class, array $context, ReflectionClass $reflectionClass, array|bool $allowedAttributes, null|string $format): object
    protected getClassDiscriminatorResolvedClass(array $data, string $class, array $context): string
    protected createConstructorArgument($parameterData, string $key, ReflectionParameter $constructorParameter, array $context, null|string $format)
    protected extractAttributes($object, $format, array $context): array<int, string>
    protected isAllowedAttribute(object|string $classOrObject, string $attribute, null|string $format, array $context): bool
    protected canAccessAttribute(null|object $object, string $attribute, array $context): bool
    protected canAccessAttributePostDenormalize(null|object $object, null|object $previousObject, string $attribute, array $context): bool
    protected validateType(string $attribute, Symfony\Component\PropertyInfo\Type $type, $value, null|string $format, array $context): null
    protected denormalizeCollection(string $attribute, ApiPlatform\Metadata\ApiProperty $propertyMetadata, Symfony\Component\PropertyInfo\Type $type, string $className, $value, null|string $format, array $context): array
    protected denormalizeRelation(string $attributeName, ApiPlatform\Metadata\ApiProperty $propertyMetadata, string $className, $value, null|string $format, array $context): object
    protected getFactoryOptions(array $context): array
    protected getAttributeValue(object $object, string $attribute, null|string $format, array $context)
    protected normalizeRelation(ApiPlatform\Metadata\ApiProperty $propertyMetadata, null|object $relatedObject, string $resourceClass, null|string $format, array $context): ArrayObject|array|string
    protected getAttributes(object $object, null|string $format, array $context): array<int, string>
    protected denormalizeParameter(ReflectionClass $class, ReflectionParameter $parameter, string $parameterName, $parameterData, array $context, null|string $format)
    protected createChildContext(array $parentContext, string $attribute, null|string $format): array
    protected isCircularReference(object $object, array $context): bool
    protected handleCircularReference(object $object, null|string $format, array $context)
    protected getGroups(array $context): array
    protected prepareForDenormalization($data): array
    protected getConstructor(array $data, string $class, array $context, ReflectionClass $reflectionClass, array|bool $allowedAttributes): ReflectionMethod
    protected validateCallbackContext(array $context, string $contextType): null
    protected applyCallbacks($value, object|string $object, string $attribute, null|string $format, array $context)
    protected getAttributeNormalizationContext(object $object, string $attribute, array $context): array
    protected getAttributeDenormalizationContext(string $class, string $attribute, array $context): array
    protected getAttributeMetadata(object|string $objectOrClass, string $attribute): Symfony\Component\Serializer\Mapping\AttributeMetadataInterface
    protected extractObjectToPopulate(string $class, array $context, null|string $key): object
    public setSerializer(Symfony\Component\Serializer\SerializerInterface $serializer)
    protected getInputClass(array $context): string
    protected getOutputClass(array $context): string
}

Properties

propertyAccessor

Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor
Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor

localCache

array $localCache
array $localCache

localFactoryOptionsCache

array $localFactoryOptionsCache
array $localFactoryOptionsCache

propertyNameCollectionFactory

ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory
ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory

propertyMetadataFactory

ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory
ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory

iriConverter

ApiPlatform\Api\IriConverterInterface $iriConverter
ApiPlatform\Api\IriConverterInterface $iriConverter

resourceClassResolver

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

resourceAccessChecker

ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker
ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker

classDiscriminatorResolver

Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface $classDiscriminatorResolver
Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface $classDiscriminatorResolver

defaultContext

$defaultContext
$defaultContext

classMetadataFactory

Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory
Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory

nameConverter

Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter
Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter

serializer

Symfony\Component\Serializer\Normalizer\SerializerInterface $serializer
Symfony\Component\Serializer\Normalizer\SerializerInterface $serializer

resourceMetadataCollectionFactory

ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory
ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory

Methods

__construct

public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\IdentifiersExtractorInterface $identifiersExtractor, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, null|Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor, null|Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter, null|Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory, null|Psr\Log\LoggerInterface $logger, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker)
public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, ApiPlatform\Api\IdentifiersExtractorInterface $identifiersExtractor, ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver, null|Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor, null|Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter, null|Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory, null|Psr\Log\LoggerInterface $logger, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker)

Parameters

propertyNameCollectionFactoryApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface
propertyMetadataFactoryApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface
iriConverterApiPlatform\Api\IriConverterInterface
identifiersExtractorApiPlatform\Api\IdentifiersExtractorInterface
resourceClassResolverApiPlatform\Api\ResourceClassResolverInterface
propertyAccessorSymfony\Component\PropertyAccess\PropertyAccessorInterface
nameConverterSymfony\Component\Serializer\NameConverter\NameConverterInterface
classMetadataFactorySymfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface
loggerPsr\Log\LoggerInterface
resourceMetadataCollectionFactoryApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface
resourceAccessCheckerApiPlatform\Symfony\Security\ResourceAccessCheckerInterface

supportsNormalization

Checks whether the given class is supported for normalization by this normalizer.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

normalize

Normalizes an object into a set of arrays/scalars.Normalizes an object into a set of arrays/scalars.

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

Parameters

object
formatstring
contextarray<string>

Returns

ArrayObject
array
string
int
float
bool

normalizeCollectionOfRelations

Normalizes a collection of relations (to-many).

protected normalizeCollectionOfRelations(ApiPlatform\Metadata\ApiProperty $propertyMetadata, iterable $attributeValue, string $resourceClass, null|string $format, array $context): array
protected normalizeCollectionOfRelations(ApiPlatform\Metadata\ApiProperty $propertyMetadata, iterable $attributeValue, string $resourceClass, null|string $format, array $context): array

Parameters

propertyMetadataApiPlatform\Metadata\ApiProperty
attributeValueiterable
resourceClassstring
formatstring
contextarray

Returns

array

supportsDenormalization

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

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

Parameters

data
typestring
formatstring
contextarray

Returns

bool

getAllowedAttributes

Gets attributes to normalize using groups.

protected getAllowedAttributes(object|string $classOrObject, array $context, bool $attributesAsString): array|bool
protected getAllowedAttributes(object|string $classOrObject, array $context, bool $attributesAsString): array|bool

Parameters

classOrObjectobject
string
contextarray
attributesAsStringbool

Returns

array
bool

setAttributeValue

Sets attribute value.

protected setAttributeValue($object, $attribute, $value, $format, array $context): null
protected setAttributeValue($object, $attribute, $value, $format, array $context): null

Parameters

object
attribute
value
format
contextarray

Returns

null

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop