Jeff - I missed your second reply to this, thanks. I was completely unaware that a join table could have any more than the two id fields and still function within cake... now I know!
This post today readdressed this issue and got a pretty good response: http://groups.google.com/group/cake-php/browse_thread/thread/a760f1a9634482c4 and Felix has a great blog post here, which is also linked from that previous thread: http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakephp-faking-rails-throughassociation/ I appreciate your help. On Jul 7, 1:34 am, Geoff Ford <[EMAIL PROTECTED]> wrote: > With a table homes_images > > id > home_id > image_id > ordering > > An image can be assigned to many houses but each house will have an > independent ordering. You will have to look into the hasMany, it has > an order option but I'm not positive on how to use it, maybe someone > else can give you a pointer on that. > > You also might need to do a manual insert of the ordering in the > afterSave callback. > > Sorry if that seems a bit vague, I've never had to do this in cake, > but it is how I would look at tackling it. > > Geoff > --http://lemoncake.wordpress.com > > On Jul 4, 11:45 pm, McFadly <[EMAIL PROTECTED]> wrote: > > > Hi Geoff, > > Thanks for the response. Your solution would be fine if I didn't have > > the stockimagesin the mix. Someimageswill be associated with > > multipleshomes, so I think I need to have a separate table that is > > somehow keeping track of whathomesthey are associated with, in > > addition to what order they appear in for that particular home. Just > > not quite sure how to pull this off... > > > On Jul 3, 8:11 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > > > > What about a field in theimagestable that is used for ordering and > > > then use 'Images.order_field' as the 3rd parameter in your findAll() > > > > Geoff > > > --http://lemoncake.wordpress.com > > > > On Jul 4, 11:14 am, McFadly <[EMAIL PROTECTED]> wrote: > > > > > Hello Bakers - > > > > > I have a situation where I can't agree on the best database schema / > > > > logic for my project. > > > > > Here's a simplified version of my project: > > > > > table:Homes > > > > table:Images > > > > > Each Home will have zero to manyImages. SomeImageswill be "stock" > > > >imagesthat can be used by manyHomes. Each group ofImages > > > > associated with a Home will be in a user defined and changeable > > > > order. > > > > >HomesHABTMImageswould provide the ability to associateimagesto > > > >homes, but how do I keep them in a specific and changeable order? > > > > > My initial thought is a table: galleries, which has a serialized list > > > > of image_ids, in a particular order. Is this my best bet, or am I > > > > overlooking a possibility? > > > > > Your thoughts and direction, please. > > > > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
