From f33e67433bb3a8e97ffc4fd039bfeac37ea7aced Mon Sep 17 00:00:00 2001 From: coolmic Date: Mon, 9 Sep 2024 12:23:52 +0200 Subject: [PATCH] Resolve the 'Unknown property mappedBy' issue when the parent field is defined before the child field in a tree structure. --- src/Tree/Hydrator/ORM/TreeObjectHydrator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tree/Hydrator/ORM/TreeObjectHydrator.php b/src/Tree/Hydrator/ORM/TreeObjectHydrator.php index cb16778419..4503b97259 100644 --- a/src/Tree/Hydrator/ORM/TreeObjectHydrator.php +++ b/src/Tree/Hydrator/ORM/TreeObjectHydrator.php @@ -249,7 +249,7 @@ protected function getChildrenField($entityClass) $associationMapping = $meta->getAssociationMapping($property->getName()); // Make sure the association is mapped by the parent property - if ($associationMapping['mappedBy'] !== $this->parentField) { + if (!isset($associationMapping['mappedBy']) || $associationMapping['mappedBy'] !== $this->parentField) { continue; }