ListNormalizer
class ListNormalizer extends NormalizerBase (View source)
Converts list objects to arrays.
Ordinarily, this would be handled automatically by Serializer, but since there is a TypedDataNormalizer and the Field class extends TypedData, any Field will be handled by that Normalizer instead of being traversed. This class ensures that TypedData classes that also implement ListInterface are traversed instead of simply returning getValue().
Traits
Properties
| protected | $supportedInterfaceOrClass | {@inheritdoc} | |
| protected string|string[] | $format | List of formats which supports (de-)normalization. |
from NormalizerBase |
Methods
Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization()
Checks if the provided format is supported by this normalizer.
{@inheritdoc}
Details
supportsNormalization($data, $format = NULL)
{@inheritdoc}
supportsDenormalization($data, $type, $format = NULL)
Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization()
This class doesn't implement DenormalizerInterface, but most of its child classes do. Therefore, this method is implemented at this level to reduce code duplication.
protected bool
checkFormat(string $format = NULL)
Checks if the provided format is supported by this normalizer.
protected
addCacheableDependency(array $context, $data)
Adds cacheability if applicable.
normalize($object, $format = NULL, array $context = [])
{@inheritdoc}