Better PHP programmers on the list than me can explain this more clearly, but my understanding is:
When you call $this->Author->User-saveField() it will create a new instance of the User class. But the instance won't have any data associated with it. If you call $this->Author->User->save() then you are required to provide an id which is then used in the query. saveField() doesn't require an id and just assumes that the id is available in the User instance. So when you setId on User you are providing an id for saveField() to work with. Regards, Langdon jyrgen wrote: > Honestly speaking it is still not clear to me, why > > $this->Author->User->save > fails due to a missing key. > > $this->Author itself is a huge object, it doesn't hold > any data. > > hmm. I'm getting the notion that i should reread everything about > models and relations. > j. > > > > > > > > > -- -- Linden Row Pty Ltd NSW : +61 2 8215 0570 Victoria : +61 3 9013 9423 Fax : +61 2 8215 0571 Mobile : +61 416 118 037 http://www.lindenrow.com.au --------------------------- Buy fine chocolate online http://www.chocolatereview.com.au --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
