[2.0][DDC-251] Fixed.
This commit is contained in:
parent
54d4476c47
commit
46ed63d131
@ -233,7 +233,7 @@ class OneToOneMapping extends AssociationMapping
|
||||
|
||||
$targetEntity = $em->getUnitOfWork()->getEntityPersister($this->targetEntityName)->load($joinColumnValues, $targetEntity, $this, $hints);
|
||||
|
||||
if ($targetEntity !== null && $inverseField) {
|
||||
if ($targetEntity !== null && $inverseField && ! $targetClass->isCollectionValuedAssociation($inverseField)) {
|
||||
$targetClass->reflFields[$inverseField]->setValue($targetEntity, $sourceEntity);
|
||||
}
|
||||
} else {
|
||||
|
@ -463,8 +463,8 @@ class UnitOfWork implements PropertyChangedListener
|
||||
|
||||
if ($class->isCollectionValuedAssociation($name) && $actualData[$name] !== null
|
||||
&& ! ($actualData[$name] instanceof PersistentCollection)) {
|
||||
// If $actualData[$name] is Collection then unwrap the array
|
||||
if ( ! $actualData[$name] instanceof ArrayCollection) {
|
||||
// If $actualData[$name] is not a Collection then use an ArrayCollection.
|
||||
if ( ! $actualData[$name] instanceof Collection) {
|
||||
$actualData[$name] = new ArrayCollection($actualData[$name]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user