Hello gentlemen,
I have a propel form class in which i override the save() function. Am
trying to save the main form object and some related objects. But when
i try to use the id of the just-added main object i find it empty. It
says in the docs. that once a propel object is saved the id should get
set and can be retrieved by getId(). Also I see the main object being
saved in the DB. Why does getId() return null? Is there any other way
to implement this logic?
thanks.
Here is my code
public function save($con = null)
{
try
{
$con->beginTransaction();
$this->object->save();
$con->commit();
$con->beginTransaction();
foreach($receivers as $reciever){
$msg_reciever = new MessageReciever();
if (sfConfig::get('sf_logging_enabled'))
{
sfContext::getInstance()->getLogger()->info("****MsgId:
" . $this->object->getId());
}
$msg_reciever->setMessageId($this->object->getId());
...
...
$msg_reciever->save();
}
$con->commit();
}
catch (Exception $e)
{
$con->rollBack();
throw $e;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---