| @@ 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 { |
|
| @@ 1964-1968 (lines=5) @@ | ||
| 1961 | $value = $prevClass->reflFields[$assocField]->getValue($previousManagedCopy); |
|
| 1962 | $value[] = $managedCopy; |
|
| 1963 | ||
| 1964 | if ($association['type'] == ClassMetadata::ONE_TO_MANY) { |
|
| 1965 | $class = $this->em->getClassMetadata(get_class($entity)); |
|
| 1966 | ||
| 1967 | $class->reflFields[$association['mappedBy']]->setValue($managedCopy, $previousManagedCopy); |
|
| 1968 | } |
|
| 1969 | } |
|
| 1970 | ||
| 1971 | /** |
|