Doctrine\DBAL\Connection::lastInsertId
Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver.
Note: This method may not return a meaningful or consistent result across different drivers, because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY columns or sequences.
Signature
public function lastInsertId([string
$seqName = null] )
Parameters
$seqName
— string- Name of the sequence object from which the ID should be returned.
Returns
- string
- A string representation of the last inserted ID.