Naive fix
This commit is contained in:
parent
4058ad3958
commit
fc8191f557
@ -55,12 +55,8 @@ class AssignedGenerator extends AbstractIdGenerator
|
||||
}
|
||||
|
||||
if (isset($class->associationMappings[$idField])) {
|
||||
if ( ! $em->getUnitOfWork()->isInIdentityMap($value)) {
|
||||
throw ORMException::entityMissingForeignAssignedId($entity, $value);
|
||||
}
|
||||
|
||||
// NOTE: Single Columns as associated identifiers only allowed - this constraint it is enforced.
|
||||
$value = current($em->getUnitOfWork()->getEntityIdentifier($value));
|
||||
$value = $em->getUnitOfWork()->getSingleIdentifierValue($value);
|
||||
}
|
||||
|
||||
$identifier[$idField] = $value;
|
||||
|
@ -76,7 +76,9 @@ final class IdentifierFlattener
|
||||
$class->associationMappings[$idField]['targetEntity']
|
||||
);
|
||||
|
||||
$associatedId = $this->unitOfWork->getEntityIdentifier($idValue);
|
||||
$associatedId = $this->unitOfWork->isInIdentityMap($idValue)
|
||||
? $this->unitOfWork->getEntityIdentifier($idValue)
|
||||
: $targetClassMetadata->getIdentifierValues($idValue);
|
||||
|
||||
$flatId[$idField] = $associatedId[$targetClassMetadata->identifier[0]];
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user