[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
You must set the user ID after saving. A possible solution would be to pass a sfGuardUser on saving of form : class PostForm { // ... public function save($author, Doctrine_Connection $conn = null) { $this-setAuthor($author); $this-save($conn); } } Another way would be to add a

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
thanks a lot, I see how to handle it now, just putting the save method as you said gives me the following warning: Strict Standards: Declaration of OpenBubbleForm::save() should be compatible with that of sfFormDoctrine::save() in /home/me/

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
The idea : class PostForm { protected $author; public function setAuthor($author) { $this-author = $author; } public function save(Doctrine_Connection $conn = null) { if ($this-author !== null) { $this-getObject()-setAuthor($this-author); }

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
thanks, it works as expected, I just had to add return parent::save($conn); instead of only parent::save($conn); to be able to use the object in a template. the only thing is that i stll get the same warning about the strict standard: Strict Standards: Declaration of OpenBubbleForm::save()

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
Yes, A strict PHP object standard is when you overload a method, you must set the same signature : - same method name - same arguments - same types To make simple, you must copy/paste the function declaration line of sfDoctrineForm.class.php : public function save(...) to

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Richtermeister
It means the signature of your save method is different. Make sure you take the same parameters as the parent function. Daniel On Oct 26, 6:19 am, mbernasocchi mbernasoc...@gmail.com wrote: thanks, it works as expected, I just had to add return parent::save($conn); instead of only

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
Thanks a lot, I was sooo into doctrine that I forgot that php can issue warnings as well ;) Again thanks On Oct 27, 7:06 am, Alexandre SALOME alexandre.sal...@gmail.com wrote: Yes, A strict PHP object standard is when you overload a method, you must set the same signature :    - same