finalize normalization on ressources

This commit is contained in:
2022-03-21 17:33:01 +01:00
parent b4add2de95
commit 169d4dc41c
6 changed files with 40 additions and 22 deletions

View File

@@ -39,7 +39,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa
*/
public function normalize($object, ?string $format = null, array $context = []): array
{
if (null === $object or (null === $object->getComment() and null === $object->getUserId() and null === $object->getDate())) {
if (null === $object || ($object->isEmpty())) {
return [
'comment' => '',
'isNull' => true,