Thansk to all!!

The solution is copy the parent::save() before take the id, example:


parent::save();

        //Insertamos en la tabla de traza de documentos
        $sfUser = sfContext::getInstance();

        $q = new document_trace();

        $q->set('id_document',$this->getId());
        $q->set('id_user', $sfUser->getUser()->getGuardUser());
        $q->set('state', '0');
        $q->set('created_at',date('Y-m-d h:i:s'));
        $q->save();


2010/1/8 Alexandru-Emil Lupu <gang.al...@gmail.com>

> Pastebin your form. Obviously you do it wrong...
> I don't have an example atm.
>
> Alecs
>
> sent via htc magic
>
> On Jan 8, 2010 2:55 AM, "Gabo" <gabopo...@gmail.com> wrote:
>
> ERROR
>
> 500 | Internal Server Error | Doctrine_Validator_Exception Validation
> failed in class document_trace
>
> 1 field had validation error:
>
> * 1 validator failed on id_document (notnull)
>
> is a new record ($ this-> getId ()), so it is empty.
>
>
>
>
> 2010/1/7 Stéphane <stephane.er...@gmail.com>
>
>> > >  $q->set('id_document', $author->getId()); <- does it work ? > > if
>> you get error message, pleas...
>> --
>>
>> > You received this message because you are subscribed to the Google
>> Groups "symfony users" group. >...
>>
>
>
> --
> 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<symfony-users%2bunsubscr...@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<symfony-users%2bunsubscr...@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