Thanks, actually each object can only 'have' one other object. A doc can only have one single comment. But I will take your advice.
On Jun 5, 6:09 am, John Andersen <[email protected]> wrote: > You should probably use dynamic binding instead af static binding in > the model! > > The only static bindings I see that you can define are: > doc hasMany comments - I assume that one document can have more than > one comment! > > Then for the other, use dynamic binding. > > Enjoy, > John > > On Jun 5, 3:28 am, Greg Baker <[email protected]> wrote: > > > I have the following scenario.. A user can upload a document, that > > document can be commented on, then a new document can be uploaded and > > 'attached' to that comment. This gives a chain of objects kind of > > like this: > > > doc-comment-doc-comment-doc-comment > > > Where the cardinality of associations is 0..1 for each association. > > In my tables I have the fields doc (comment_id) and a field in comment > > (doc_id). > > I have tried making the following associations in my models: > > > doc belongsTo comment > > doc hasOne comment > > > comment belongsTo doc > > comment hasOne doc > > > ...but this gives me a weird SQL error: "Not unique table/alias: > > 'Comment'". I'm kind of lost, can anyone help me? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
