1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/lib/Doctrine/ORM/Id/IdentityGenerator.php

29 lines
522 B
PHP

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