This can be done by adding another association, hasOne... Then the customers model will have both a hasMany and a hasOne association to the same table (addresses). Only remember to specify that default_address_id is the foreign_key for the hasOne association... I think it's something like that :)
// J.B. On 29 Nov, 00:02, FrenchEscapes <[EMAIL PROTECTED]> wrote: > I have a customers table and an addresses table, customers hasMany > addresses, that bit's easy. > > But I want each customer to have a default address in the addresses > table. I have a field 'default_address_id' in the customer table. I > just can't get my head around how to use associations to link them. > > Thank you in advance. > > Duncan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---