2008-08-31 18:27:16 +00:00
|
|
|
<?php
|
|
|
|
|
2009-01-22 19:38:10 +00:00
|
|
|
namespace Doctrine\ORM\Id;
|
|
|
|
|
|
|
|
class IdentityGenerator extends AbstractIdGenerator
|
2008-08-31 18:27:16 +00:00
|
|
|
{
|
2008-09-07 13:48:40 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
2008-09-12 10:40:23 +00:00
|
|
|
* @param Doctrine_ORM_Entity $entity
|
2008-09-07 13:48:40 +00:00
|
|
|
* @return unknown
|
|
|
|
* @override
|
|
|
|
*/
|
2008-12-18 14:08:11 +00:00
|
|
|
public function generate($entity)
|
2008-09-07 13:48:40 +00:00
|
|
|
{
|
|
|
|
return $this->_em->getConnection()->lastInsertId();
|
2008-08-31 18:27:16 +00:00
|
|
|
}
|
2009-01-03 19:50:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return boolean
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
public function isPostInsertGenerator() {
|
|
|
|
return true;
|
|
|
|
}
|
2008-08-31 18:27:16 +00:00
|
|
|
}
|
|
|
|
|