You are trying to get the inserted id in the if block: if ($this->isNew()) ??? 
Well, you are wrinting it, the object is not yet saved!

Call parent::save($conn) and then you can get the id from the object.


Cheers, Daniel

On Jan 6, 2010, at 11:48 PM, Gabo wrote:

> HELP!!
> 
> 
> I try to capture the id of a new record for storage in an external table 
> (document_trace) but not what brings me
> 
> 
> 
> /lib/model/doctrine/template.class.php
> 
> 
> public function save(Doctrine_Connection $conn = null) {
> 
>     if ($this->isNew()) {
> 
>         $sfUser =sfContext::getInstance();
> 
>         $q = new document_trace();
> 
>         $q->set('id_document', $this->getId(););    //Error getId is empty???
> 
>         $q->set('id_user',$sfUser->getUser()->getGuardUser());
> 
>         $q->set('state', '0');
> 
>         $q->save();
> 
>     }
> 
>     return parent::save($conn);
> 
> }
> 
> 
> 
> Thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> symfony-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/symfony-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.

Reply via email to