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(
|
$id = array(
|
||||||
$this->class->identifier[0] => $generatedId
|
$this->class->identifier[0] => $generatedId
|
||||||
);
|
);
|
||||||
$postInsertIds[$generatedId] = $entity;
|
$postInsertIds[] = array(
|
||||||
|
'generatedId' => $generatedId,
|
||||||
|
'entity' => $entity,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$id = $this->class->getIdentifierValues($entity);
|
$id = $this->class->getIdentifierValues($entity);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
|
|||||||
$id = array(
|
$id = array(
|
||||||
$this->class->identifier[0] => $generatedId
|
$this->class->identifier[0] => $generatedId
|
||||||
);
|
);
|
||||||
$postInsertIds[$generatedId] = $entity;
|
$postInsertIds[] = array(
|
||||||
|
'generatedId' => $generatedId,
|
||||||
|
'entity' => $entity,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$id = $this->em->getUnitOfWork()->getEntityIdentifier($entity);
|
$id = $this->em->getUnitOfWork()->getEntityIdentifier($entity);
|
||||||
}
|
}
|
||||||
|
@ -1019,7 +1019,9 @@ class UnitOfWork implements PropertyChangedListener
|
|||||||
|
|
||||||
if ($postInsertIds) {
|
if ($postInsertIds) {
|
||||||
// Persister returned post-insert IDs
|
// 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);
|
$oid = spl_object_hash($entity);
|
||||||
$idField = $class->identifier[0];
|
$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
|
if ( ! is_null($this->mockIdGeneratorType) && $this->mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY
|
||||||
|| $this->class->isIdGeneratorIdentity()) {
|
|| $this->class->isIdGeneratorIdentity()) {
|
||||||
$id = $this->identityColumnValueCounter++;
|
$id = $this->identityColumnValueCounter++;
|
||||||
$this->postInsertIds[$id] = $entity;
|
$this->postInsertIds[] = array(
|
||||||
|
'generatedId' => $id,
|
||||||
|
'entity' => $entity,
|
||||||
|
);
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user