public getLastInsertID ( ) : integer | ||
return | integer | last insert id, null if none is found. |
public function getLastInsertID()
{
foreach ($this->getTableInfo()->getColumns() as $column) {
if ($column->hasSequence()) {
$command = $this->getDbConnection()->createCommand('SELECT @@Identity');
return intval($command->queryScalar());
}
}
}