Skip to content

Commit

Permalink
Resolve the 'Unknown property mappedBy' issue when the parent field i…
Browse files Browse the repository at this point in the history
…s defined before the child field in a tree structure.
  • Loading branch information
coolmic committed Sep 9, 2024
1 parent ade7387 commit f33e674
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tree/Hydrator/ORM/TreeObjectHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f33e674

Please sign in to comment.