In Doctrine2 using some thing like:
$user = array(\'username\' => \'example\', \'passsword\' => \'changeme\'); $conn->insert(\'users\', $user);
$conn->lastInsertId();will get you the last inserted ID when only using Doctrine's DBAL (sans ORM).
$conn->lastInsertId();