AbstractNormalizer

class AbstractNormalizer extends SerializerAwareNormalizer implements NormalizerInterface, DenormalizerInterface

Normalizer implementation.

Constants

CIRCULAR_REFERENCE_LIMIT
OBJECT_TO_POPULATE
GROUPS

Methods

setSerializer(SerializerInterface $serializer)

Sets the owning Serializer object.

from SerializerAwareNormalizer
__construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null)

Sets the {@link ClassMetadataFactoryInterface} to use.

AbstractNormalizer setCircularReferenceLimit(int $circularReferenceLimit)

Set circular reference limit.

AbstractNormalizer setCircularReferenceHandler(callable $circularReferenceHandler)

Set circular reference handler.

AbstractNormalizer setCallbacks(array $callbacks)

Set normalization callbacks.

AbstractNormalizer setIgnoredAttributes(array $ignoredAttributes)

Set ignored attributes for normalization and denormalization.

AbstractNormalizer setCamelizedAttributes(array $camelizedAttributes) deprecated

Set attributes to be camelized on denormalize.

Details

setSerializer(SerializerInterface $serializer)

Sets the owning Serializer object.

Parameters

SerializerInterface $serializer

__construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null)

Sets the {@link ClassMetadataFactoryInterface} to use.

Parameters

ClassMetadataFactoryInterface $classMetadataFactory
NameConverterInterface $nameConverter

AbstractNormalizer setCircularReferenceLimit(int $circularReferenceLimit)

Set circular reference limit.

Parameters

int $circularReferenceLimit limit of iterations for the same object

Return Value

AbstractNormalizer

AbstractNormalizer setCircularReferenceHandler(callable $circularReferenceHandler)

Set circular reference handler.

Parameters

callable $circularReferenceHandler

Return Value

AbstractNormalizer

Exceptions

InvalidArgumentException

AbstractNormalizer setCallbacks(array $callbacks)

Set normalization callbacks.

Parameters

array $callbacks help normalize the result

Return Value

AbstractNormalizer

Exceptions

InvalidArgumentException if a non-callable callback is set

AbstractNormalizer setIgnoredAttributes(array $ignoredAttributes)

Set ignored attributes for normalization and denormalization.

Parameters

array $ignoredAttributes

Return Value

AbstractNormalizer

AbstractNormalizer setCamelizedAttributes(array $camelizedAttributes) deprecated

deprecated

Deprecated since version 2.7, to be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.

Set attributes to be camelized on denormalize.

Parameters

array $camelizedAttributes

Return Value

AbstractNormalizer

Exceptions

LogicException

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.html