Skip to content

Commit

Permalink
Also run this on multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Jan 16, 2024
1 parent 8906eb2 commit aaf6dda
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/src/Entity/ObjectEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,11 @@ public function toArray(array $configuration = []): array
$config['maxDepth'] = $attribute->getObject()->getMaxDepth() + $config['level'];
}
$config['level'] = $config['level'] + 1;

//TODO: This is a very hacky solution that has to be changed back ASAP
if ($attribute->getObject() === $this->getEntity()) {
$config['maxDepth'] = $config['level'];
}
$objectToArray = $object->toArray($config);

// Check if we want an embedded array
Expand Down

0 comments on commit aaf6dda

Please sign in to comment.