Skip to content

Commit

Permalink
persist empty relation as null instead of omitting it from the ES doc…
Browse files Browse the repository at this point in the history
…ument
  • Loading branch information
limenet committed Apr 17, 2024
1 parent d34fada commit 7301d28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Document/DataObjectNormalizerTrait.php
Expand Up @@ -128,6 +128,8 @@ protected function relationAttributes(Concrete $element, array $fields): array
$data = is_callable($source) ? $source($element) : $element->get($source);

if ($data === null) {
$result[$target] = null;

continue;
}

Expand Down

0 comments on commit 7301d28

Please sign in to comment.