| @@ 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 { |
|
| @@ 1941-1945 (lines=5) @@ | ||
| 1938 | $value = $prevClass->reflFields[$assocField]->getValue($previousManagedCopy); |
|
| 1939 | $value[] = $managedCopy; |
|
| 1940 | ||
| 1941 | if ($association['type'] == ClassMetadata::ONE_TO_MANY) { |
|
| 1942 | $class = $this->em->getClassMetadata(get_class($entity)); |
|
| 1943 | ||
| 1944 | $class->reflFields[$association['mappedBy']]->setValue($managedCopy, $previousManagedCopy); |
|
| 1945 | } |
|
| 1946 | } |
|
| 1947 | ||
| 1948 | /** |
|