On 6/28/07, Romano <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Is it possible to associate two models twice using hasOne ?
>
> E.g. A Message model is associated with a User model twice. Once for
> the sender and once for the receiver. Both are roles of a user.
yes
var $hasOne = array('Sender'=>array('className'=>'User',
'foreignKey'=>'sender_id'), 'Receiver'=>array('className'=>'User',
'foreignKey'=>'receiver_id'));
hth
jon
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---