Prevent multiples sub-queries.

This commit is contained in:
Pol Dellaiera
2021-06-30 22:44:43 +02:00
parent e1f8aa5a5e
commit ef6c5870b5
2 changed files with 12 additions and 2 deletions

View File

@@ -15,7 +15,13 @@ final class FlatHierarchyEntityHydrator extends ObjectHydrator
{
$generator = $this->buildRecursively(
parent::hydrateAllData(),
static fn($value): iterable => $value->getChildren(),
static function($value): iterable {
$children = $value->getChildren();
$children->setInitialized(true);
return $children;
}
);
$result = [];