在将它保存在symfony 1.4之后,如何取回对象的id?

I was reading that if I make for example

$car = new Car();
$car->set('name','my car');
$car->set('color','orange');
and so on...

and if i make $car->save();

after that I will be able to make $car->getCarId(); (in case the id field was mapped as CarId, Ive been trying this, but I get null everytime, and the info is persisted on the DB, I dont know how to retrieve that information, any idea how to do this?

I depends on the ORM you are using:

For doctrine try:

$car->id; or $car->getId();

For propel only use:

$car->getId();

Note These are only default values, if you defined something else then 'id' as your primary key field use the one you defined in the getter.