1
0
mirror of synced 2024-12-14 15:16:04 +03:00

Merge branch 'DDC-1490'

This commit is contained in:
Benjamin Eberlei 2011-11-13 15:37:04 +01:00
commit 146f8f81f7
2 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ class IdentityGenerator extends AbstractIdGenerator
*/
public function generate(EntityManager $em, $entity)
{
return $em->getConnection()->lastInsertId($this->_seqName);
return (int)$em->getConnection()->lastInsertId($this->_seqName);
}
/**

View File

@ -46,7 +46,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
$this->_sequenceName = $sequenceName;
$this->_allocationSize = $allocationSize;
}
/**
* Generates an ID for the given entity.
*
@ -60,11 +60,11 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
// Allocate new values
$conn = $em->getConnection();
$sql = $conn->getDatabasePlatform()->getSequenceNextValSQL($this->_sequenceName);
$this->_nextValue = $conn->fetchColumn($sql);
$this->_nextValue = (int)$conn->fetchColumn($sql);
$this->_maxValue = $this->_nextValue + $this->_allocationSize;
}
return $this->_nextValue++;
}
@ -99,7 +99,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
public function unserialize($serialized)
{
$array = unserialize($serialized);
$this->_sequenceName = $array['sequenceName'];
$this->_allocationSize = $array['allocationSize'];
}