From a33aa15c798f6496d37c41ea89785174e61a225f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 15 May 2023 11:27:48 +0200 Subject: [PATCH] Remove unreachable piece of code mappedBy is never defined on an inverse relationship. Bi-directional self-referencing should IMO still result in 2 separate associations, on 2 separate fields of the same class, like mentor or mentee. --- lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php | 3 --- psalm-baseline.xml | 1 - 2 files changed, 4 deletions(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index c2fb4e99bcd..446f42528d2 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -458,9 +458,6 @@ protected function hydrateRowData(array $row, array &$result) $targetClass->reflFields[$inverseAssoc['fieldName']]->setValue($element, $parentObject); $this->_uow->setOriginalEntityProperty(spl_object_id($element), $inverseAssoc['fieldName'], $parentObject); } - } elseif ($parentClass === $targetClass && $relation['mappedBy']) { - // Special case: bi-directional self-referencing one-one on the same class - $targetClass->reflFields[$relationField]->setValue($element, $parentObject); } } else { // For sure bidirectional, as there is no inverse side in unidirectional mappings diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b480604632d..d45828570ec 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -485,7 +485,6 @@ getValue setValue setValue - setValue associationMappings[$class->identifier[0]]['joinColumns']]]>