1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/lib/Doctrine/ORM/Id/IdentityGenerator.php

29 lines
522 B
PHP
Raw Normal View History

<?php
namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager;
class IdentityGenerator extends AbstractIdGenerator
{
2008-09-07 17:48:40 +04:00
/**
* Generates an ID for the given entity.
2008-09-07 17:48:40 +04:00
*
* @param object $entity
* @return integer|float
2008-09-07 17:48:40 +04:00
* @override
*/
public function generate(EntityManager $em, $entity)
2008-09-07 17:48:40 +04:00
{
return $em->getConnection()->lastInsertId();
}
/**
* @return boolean
* @override
*/
public function isPostInsertGenerator()
{
return true;
}
}