Fix: generated IDs are converted to integer
This commit is contained in:
parent
d1a695b42b
commit
e57be9da5e
@ -285,7 +285,10 @@ class BasicEntityPersister implements EntityPersister
|
||||
$id = array(
|
||||
$this->class->identifier[0] => $generatedId
|
||||
);
|
||||
$postInsertIds[$generatedId] = $entity;
|
||||
$postInsertIds[] = array(
|
||||
'generatedId' => $generatedId,
|
||||
'entity' => $entity,
|
||||
);
|
||||
} else {
|
||||
$id = $this->class->getIdentifierValues($entity);
|
||||
}
|
||||
|
@ -180,7 +180,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
|
||||
$id = array(
|
||||
$this->class->identifier[0] => $generatedId
|
||||
);
|
||||
$postInsertIds[$generatedId] = $entity;
|
||||
$postInsertIds[] = array(
|
||||
'generatedId' => $generatedId,
|
||||
'entity' => $entity,
|
||||
);
|
||||
} else {
|
||||
$id = $this->em->getUnitOfWork()->getEntityIdentifier($entity);
|
||||
}
|
||||
|
@ -1019,7 +1019,9 @@ class UnitOfWork implements PropertyChangedListener
|
||||
|
||||
if ($postInsertIds) {
|
||||
// Persister returned post-insert IDs
|
||||
foreach ($postInsertIds as $id => $entity) {
|
||||
foreach ($postInsertIds as $postInsertId) {
|
||||
$id = $postInsertId['generatedId'];
|
||||
$entity = $postInsertId['entity'];
|
||||
$oid = spl_object_hash($entity);
|
||||
$idField = $class->identifier[0];
|
||||
|
||||
|
@ -55,7 +55,10 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\Entity\BasicEntityPer
|
||||
if ( ! is_null($this->mockIdGeneratorType) && $this->mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY
|
||||
|| $this->class->isIdGeneratorIdentity()) {
|
||||
$id = $this->identityColumnValueCounter++;
|
||||
$this->postInsertIds[$id] = $entity;
|
||||
$this->postInsertIds[] = array(
|
||||
'generatedId' => $id,
|
||||
'entity' => $entity,
|
||||
);
|
||||
return $id;
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user