Skip to content

Commit

Permalink
Merge pull request #1633 from ConductionNL/feature/GW-1606/response-r…
Browse files Browse the repository at this point in the history
…elation-uuids

Return uuids and not empty array when setting relations (post/put/patch)
  • Loading branch information
WilcoLouwerse authored Mar 25, 2024
2 parents 2c131d0 + 3dfe041 commit 9dee4b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/Entity/ObjectEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,9 @@ public function toArray(array $configuration = []): array
}
} elseif (count($valueObject->getObjects()) === 0) {
$array[$attribute->getName()] = [];
if (empty($valueObject->getArrayValue()) === false) {
$array[$attribute->getName()] = $valueObject->getArrayValue();
}
} else {
$currentObjects[] = $valueObject->getObjects()->toArray();
foreach ($valueObject->getObjects() as $object) {
Expand Down

0 comments on commit 9dee4b2

Please sign in to comment.