ContextAwareNormalizerInterface

interface ContextAwareNormalizerInterface implements NormalizerInterface

Adds the support of an extra $context parameter for the supportsNormalization method.

Methods

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

Normalizes an object into a set of arrays/scalars.

from NormalizerInterface
bool supportsNormalization(mixed $data, string $format = null, array $context = array())

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

Details

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

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

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
array $context

Return Value

bool