IdentityGenerator.php 449 Bytes
Newer Older
1 2 3 4
<?php

class Doctrine_Id_IdentityGenerator extends Doctrine_Id_AbstractIdGenerator
{
romanb's avatar
romanb committed
5 6 7 8 9 10 11 12
    /**
     * Enter description here...
     *
     * @param Doctrine_Entity $entity
     * @return unknown
     * @override
     */
    public function generate(Doctrine_Entity $entity)
13
    {
romanb's avatar
romanb committed
14 15 16 17 18 19
        return self::POST_INSERT_INDICATOR;
    }
    
    public function getPostInsertId()
    {
        return $this->_em->getConnection()->lastInsertId();
20 21 22 23
    }
}

?>