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