Doh! Found the answer in another thread - wasn't immediately clear in
the over docs but that's probably me.

setting

var $primayKey = 'override_fieldname';

will let you do just that :)

On Feb 11, 7:05 pm, "Dan" <[EMAIL PROTECTED]> wrote:
> Hi
>
> developing a very simple webmail app in cake and am having trouble
> with the association between the MailMessage model and it's related
> sender's Contact model.
>
> I want to relate the MailMessage as 'belongsTo' Contact via the
> MailMessage and Contacts email field - only I can't seem to work out
> how to do it, as it's automagically assuming that the field on the
> Contact model is Contact.id.
>
> Can I override the primary key as follows?
>
> MailMessage.fromAddress = Contact.emailAddress
>
> I suspect, I've not fully understood associations and that there is a
> much more striaghtforward way to do this :)
>
> Many thanks
>
> D


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to