On 8 Jan 2010, at 00:02, Gabo wrote: > > HELP!!! > > > I TRY THIS: > > //lib/model/doctrine/document.class.php > > public function save(Doctrine_Connection $conn = null) { > > $author= new document(); > > $author->setName($this->getName()); > $author->setDocumentDescription($this->getDocumentDescription()); > $author->save(); > > $sfUser = sfContext::getInstance(); > > $q = new document_trace(); > $q->set('id_document', $author); > //NOT WORK, ERROR
Should be.... $q->set('id_document', $author->getId()); > $q->set('id_user', $sfUser->getUser()->getGuardUser()); > $q->set('state', '0'); > $q->save(); > > return parent::save(); > } > > I want to save to another table for example (date, id_user, id_document) of > the creation of a document for an audit ... > > I then keeping of large app / document to store the audit log .. but I have > to take the new id_document > > HELP!! > > > > > > 2010/1/6 Eno <symb...@gmail.com> > On Wed, 6 Jan 2010, 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 > > The ID comes from the database but you haven't saved the object so it has > no ID yet. > > > > -- > > > > -- > > 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.
-- 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.