Implement NormalizerInterface::getSupportedTypes().
See https://symfony.com/doc/current/serializer/custom_normalizer.html#improving-performance-of-normalizers-denormalizers
This commit is contained in:
parent
81c3cd2ec0
commit
3398eb0170
|
@ -128,4 +128,13 @@ class ContentEntityGeometryNormalizer implements NormalizerInterface, Serializer
|
|||
return $invalid_count === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedTypes(?string $format): array {
|
||||
return [
|
||||
GeometryWrapper::class => TRUE,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -163,4 +163,13 @@ class KmlNormalizer implements NormalizerInterface, DenormalizerInterface {
|
|||
return ['name', 'entity_type', 'bundle', 'internal_id', 'description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSupportedTypes(?string $format): array {
|
||||
return [
|
||||
GeometryWrapper::class => TRUE,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue