JsonApiDocumentTopLevelNormalizer
class JsonApiDocumentTopLevelNormalizer extends NormalizerBase implements DenormalizerInterface, NormalizerInterface (View source)
| internal | JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it. |
Normalizes the top-level document according to the JSON:API specification.
Traits
Properties
| protected | $supportedInterfaceOrClass | {@inheritdoc} | |
| protected | $format | {@inheritdoc} | from NormalizerBase |
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected ResourceTypeRepositoryInterface | $resourceTypeRepository | The JSON:API resource type repository. |
Methods
Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization()
Checks if the provided format is supported by this normalizer.
Rasterizes a value recursively.
Constructs a JsonApiDocumentTopLevelNormalizer object.
{@inheritdoc}
{@inheritdoc}
Normalizes an error collection.
Normalizes omitted data into a set of omission links.
Performs minimal validation of the document.
Hashes an omitted link.
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.
static protected mixed
rasterizeValueRecursive(mixed $value)
Rasterizes a value recursively.
This is mainly for configuration entities where a field can be a tree of values to rasterize.
__construct(EntityTypeManagerInterface $entity_type_manager, ResourceTypeRepositoryInterface $resource_type_repository)
Constructs a JsonApiDocumentTopLevelNormalizer object.
denormalize($data, $class, $format = NULL, array $context = [])
{@inheritdoc}
normalize($object, $format = NULL, array $context = [])
{@inheritdoc}
protected CacheableNormalization
normalizeErrorDocument(JsonApiDocumentTopLevel $document, string $format, array $context = [])
Normalizes an error collection.
protected CacheableNormalization|CacheableOmission
normalizeOmissionsLinks(OmittedData $omissions, string $format, array $context = [])
Normalizes omitted data into a set of omission links.
static protected
validateRequestBody(array $document, ResourceType $resource_type)
Performs minimal validation of the document.
static protected string
getLinkHash(string $salt, string $link_href)
Hashes an omitted link.