On Wed, Sep 9, 2009 at 2:24 PM, John Andersen <[email protected]> wrote: > > Hi Brian, > > If the information is correct, that the meeting only takes place > yearly, then I would not care to retrieve the non-members information > or even keep it for long. > > Then my models would be: > > meetings -> hasMany -> non-members (thus the non-members register > their information every time for every meeting) > meetings -> hasAndBelongsToMany -> members (where the intersection > table will be the attendees table, just named differently to comply > with CakePHP standards) > > The CakePHP models are: > Meeting (hasAndBelongsToMany Member, hasMany Guest) > Member (hasAndBelongsToMany Meeting) > Guest (belongsTo Meeting) > > Should the meeting take place a lot more often, then I would still go > with the two models, one for the members and one for the guests (non- > members). > > You will then have to intersection tables, guests_meetings and > meetings_members. > > The CakePHP models are: > Meeting (hasAndBelongsToMany Member, hasAndBelongsToMany Guest) > Member (hasAndBelongsToMany Meeting) > Guest (hasAndBelongsToMany Meeting) > > Your model find (Meeting->find) should do a recursive find so that for > the chosen meeting, it will pull up all the attendees from the Member > model and the Guest model. > > Does this help you on the way? > John
Yes, that makes perfect sense. I think I'll go with the 2nd version. I know that the client will want to keep Guest info around, if only to be able to contact each of them when the next meeting comes around. It's also possible that they may want to contact them for other things (like to convince them to become members). Thanks a bunch. I'd managed to confuse myself for some reason. It's all clear now and I think it'll work just fine. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
