If you are not using entities, but Native SQL, as shown here , you may need to get the last inserted identifier, as shown below:
$entityManager->getConnection()->lastInsertId()
For databases with sequences such as PostgreSQL , please do not specify that you can specify the sequence name as the first parameter of the lastInsertId method.
$entityManager->getConnection()->lastInsertId($seqName = 'my_sequence')
For more information, check out the GitHub code here and.
Francesco Casula Nov 10 '14 at 16:24 2014-11-10 16:24
source share