| @@ 448-451 (lines=4) @@ | ||
| 445 | // If there is an inverse mapping on the target class its bidirectional |
|
| 446 | if ($relation['inversedBy']) { |
|
| 447 | $inverseAssoc = $targetClass->associationMappings[$relation['inversedBy']]; |
|
| 448 | if ($inverseAssoc['type'] & ClassMetadata::TO_ONE) { |
|
| 449 | $targetClass->reflFields[$inverseAssoc['fieldName']]->setValue($element, $parentObject); |
|
| 450 | $this->_uow->setOriginalEntityProperty(spl_object_hash($element), $inverseAssoc['fieldName'], $parentObject); |
|
| 451 | } |
|
| 452 | } else if ($parentClass === $targetClass && $relation['mappedBy']) { |
|
| 453 | // Special case: bi-directional self-referencing one-one on the same class |
|
| 454 | $targetClass->reflFields[$relationField]->setValue($element, $parentObject); |
|
| @@ 456-460 (lines=5) @@ | ||
| 453 | // Special case: bi-directional self-referencing one-one on the same class |
|
| 454 | $targetClass->reflFields[$relationField]->setValue($element, $parentObject); |
|
| 455 | } |
|
| 456 | } else { |
|
| 457 | // For sure bidirectional, as there is no inverse side in unidirectional mappings |
|
| 458 | $targetClass->reflFields[$relation['mappedBy']]->setValue($element, $parentObject); |
|
| 459 | $this->_uow->setOriginalEntityProperty(spl_object_hash($element), $relation['mappedBy'], $parentObject); |
|
| 460 | } |
|
| 461 | // Update result pointer |
|
| 462 | $this->resultPointers[$dqlAlias] = $element; |
|
| 463 | } else { |
|
| @@ 1989-1993 (lines=5) @@ | ||
| 1986 | $value = $prevClass->reflFields[$assocField]->getValue($previousManagedCopy); |
|
| 1987 | $value[] = $managedCopy; |
|
| 1988 | ||
| 1989 | if ($association['type'] == ClassMetadata::ONE_TO_MANY) { |
|
| 1990 | $class = $this->em->getClassMetadata(get_class($entity)); |
|
| 1991 | ||
| 1992 | $class->reflFields[$association['mappedBy']]->setValue($managedCopy, $previousManagedCopy); |
|
| 1993 | } |
|
| 1994 | } |
|
| 1995 | ||
| 1996 | /** |
|