Wednesday, April 16, 2008

symfony get insert_id

To get the last inserted record id in symfony, you can do as below:

$newHistory = new History();
$newHistory->setUpdateTime($now);
$newHistory->save();
$newHistory->getId()

No comments: