AbstractNormalizer

class AbstractNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface

Normalizer implementation.

Traits

ObjectToPopulateTrait
SerializerAwareTrait SerializerAware trait.

Constants

CIRCULAR_REFERENCE_LIMIT
OBJECT_TO_POPULATE
GROUPS
ATTRIBUTES
ALLOW_EXTRA_ATTRIBUTES

Methods

setSerializer(SerializerInterface $serializer)

Sets the serializer.

from SerializerAwareTrait
__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.

Details

setSerializer(SerializerInterface $serializer)

Sets the serializer.

Parameters

SerializerInterface $serializer A SerializerInterface instance

__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

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

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