php - How can I get back the id of my object after save it on symfony 1.4? -
i reading if make example
$car = new car(); $car->set('name','my car'); $car->set('color','orange'); , on...
and if make $car->save();
after able make $car->getcarid();
(in case id field mapped carid, ive been trying this, null everytime, , info persisted on db, dont know how retrieve information, idea how this?
i depends on orm using:
for doctrine try:
$car->id; or $car->getid();
for propel use:
$car->getid();
note these default values, if defined else 'id' primary key field use 1 defined in getter.
Comments
Post a Comment