Code Duplication    Length = 4-5 lines in 3 locations

lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 2 locations

@@ 447-450 (lines=4) @@
444
                                // If there is an inverse mapping on the target class its bidirectional
445
                                if ($relation['inversedBy']) {
446
                                    $inverseAssoc = $targetClass->associationMappings[$relation['inversedBy']];
447
                                    if ($inverseAssoc['type'] & ClassMetadata::TO_ONE) {
448
                                        $targetClass->reflFields[$inverseAssoc['fieldName']]->setValue($element, $parentObject);
449
                                        $this->_uow->setOriginalEntityProperty(spl_object_hash($element), $inverseAssoc['fieldName'], $parentObject);
450
                                    }
451
                                } else if ($parentClass === $targetClass && $relation['mappedBy']) {
452
                                    // Special case: bi-directional self-referencing one-one on the same class
453
                                    $targetClass->reflFields[$relationField]->setValue($element, $parentObject);
@@ 455-459 (lines=5) @@
452
                                    // Special case: bi-directional self-referencing one-one on the same class
453
                                    $targetClass->reflFields[$relationField]->setValue($element, $parentObject);
454
                                }
455
                            } else {
456
                                // For sure bidirectional, as there is no inverse side in unidirectional mappings
457
                                $targetClass->reflFields[$relation['mappedBy']]->setValue($element, $parentObject);
458
                                $this->_uow->setOriginalEntityProperty(spl_object_hash($element), $relation['mappedBy'], $parentObject);
459
                            }
460
                            // Update result pointer
461
                            $this->resultPointers[$dqlAlias] = $element;
462
                        } else {

lib/Doctrine/ORM/UnitOfWork.php 1 location

@@ 1960-1964 (lines=5) @@
1957
        $value   = $prevClass->reflFields[$assocField]->getValue($previousManagedCopy);
1958
        $value[] = $managedCopy;
1959
1960
        if ($association['type'] == ClassMetadata::ONE_TO_MANY) {
1961
            $class = $this->em->getClassMetadata(get_class($entity));
1962
1963
            $class->reflFields[$association['mappedBy']]->setValue($managedCopy, $previousManagedCopy);
1964
        }
1965
    }
1966
1967
    /**