Guides
Tutorials
Generic item normalizer.
class ApiPlatform\Serializer\ItemNormalizer extends ApiPlatform\Serializer\AbstractItemNormalizer implements Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface, Symfony\Component\Serializer\SerializerAwareInterface, Symfony\Component\Serializer\Normalizer\DenormalizerInterface, Symfony\Component\Serializer\Normalizer\NormalizerInterface
{
public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, 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 $resourceMetadataFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker, array $defaultContext)
public denormalize($data, string $class, null|string $format, array $context)
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
public supportsDenormalization($data, string $type, null|string $format, array $context): 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 getAllowedAttributes(object|string $classOrObject, array $context, bool $attributesAsString): array|bool
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 setAttributeValue(object $object, string $attribute, $value, null|string $format, array $context): null
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 normalizeCollectionOfRelations(ApiPlatform\Metadata\ApiProperty $propertyMetadata, iterable $attributeValue, string $resourceClass, null|string $format, array $context): array
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\Serializer\ItemNormalizer extends ApiPlatform\Serializer\AbstractItemNormalizer implements Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface, Symfony\Component\Serializer\SerializerAwareInterface, Symfony\Component\Serializer\Normalizer\DenormalizerInterface, Symfony\Component\Serializer\Normalizer\NormalizerInterface
{
public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, 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 $resourceMetadataFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker, array $defaultContext)
public denormalize($data, string $class, null|string $format, array $context)
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
public supportsDenormalization($data, string $type, null|string $format, array $context): 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 getAllowedAttributes(object|string $classOrObject, array $context, bool $attributesAsString): array|bool
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 setAttributeValue(object $object, string $attribute, $value, null|string $format, array $context): null
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 normalizeCollectionOfRelations(ApiPlatform\Metadata\ApiProperty $propertyMetadata, iterable $attributeValue, string $resourceClass, null|string $format, array $context): array
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
}
Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor
Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor
array $localCache
array $localCache
array $localFactoryOptionsCache
array $localFactoryOptionsCache
ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory
ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory
ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory
ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory
ApiPlatform\Api\IriConverterInterface $iriConverter
ApiPlatform\Api\IriConverterInterface $iriConverter
ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver
ApiPlatform\Api\ResourceClassResolverInterface $resourceClassResolver
ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker
ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker
Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface $classDiscriminatorResolver
Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface $classDiscriminatorResolver
$defaultContext
$defaultContext
Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory
Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory
Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter
Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter
Symfony\Component\Serializer\Normalizer\SerializerInterface $serializer
Symfony\Component\Serializer\Normalizer\SerializerInterface $serializer
ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory
ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory
public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, 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 $resourceMetadataFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker, array $defaultContext)
public __construct(ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Api\IriConverterInterface $iriConverter, 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 $resourceMetadataFactory, null|ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface $resourceAccessChecker, array $defaultContext)
propertyNameCollectionFactory | ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface | |
propertyMetadataFactory | ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface | |
iriConverter | ApiPlatform\Api\IriConverterInterface | |
resourceClassResolver | ApiPlatform\Api\ResourceClassResolverInterface | |
propertyAccessor | Symfony\Component\PropertyAccess\PropertyAccessorInterface | |
nameConverter | Symfony\Component\Serializer\NameConverter\NameConverterInterface | |
classMetadataFactory | Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface | |
logger | Psr\Log\LoggerInterface | |
resourceMetadataFactory | ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface | |
resourceAccessChecker | ApiPlatform\Symfony\Security\ResourceAccessCheckerInterface | |
defaultContext | array |
Denormalizes data back into an object of the given class.Denormalizes data back into an object of the given class.
public denormalize($data, string $class, null|string $format, array $context)
public denormalize($data, string $class, null|string $format, array $context)
data | ||
class | string | |
format | string | |
context | array |