interface NormalizerInterface

Defines the interface of normalizers.

Methods

array|scalar
normalize(object $object, string $format = null, array $context = array())

Normalizes an object into a set of arrays/scalars.

bool
supportsNormalization(mixed $data, string $format = null)

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

Details

at line line 39
array|scalar normalize(object $object, string $format = null, array $context = array())

Normalizes an object into a set of arrays/scalars.

Parameters

object $object object to normalize
string $format format the normalization result will be encoded as
array $context Context options for the normalizer

Return Value

array|scalar

Exceptions

InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer
CircularReferenceException Occurs when the normalizer detects a circular reference when no circular reference handler can fix it
LogicException Occurs when the normalizer is not called in an expected context

at line line 49
bool supportsNormalization(mixed $data, string $format = null)

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

Parameters

mixed $data Data to normalize
string $format The format being (de-)serialized from or into

Return Value

bool