1
0
mirror of synced 2025-01-18 22:41:43 +03:00

[2.0][DDC-251] Fixed.

This commit is contained in:
romanb 2010-01-18 12:50:39 +00:00
parent 54d4476c47
commit 46ed63d131
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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]);
}