Message Model with Sender and Recipient from User-Table

2010-06-04 Thread nils
Hi all, I've got a messages model with two fields called sender and recipient which I'd like to link to the users table. I tried: -- var $hasOne = array( 'User' = array( 'className' = 'User', 'foreignKey' = 'sender',

Re: Message Model with Sender and Recipient from User-Table

2010-06-04 Thread Jeremy Burns
Try: var $hasOne = array( 'Sender' = array( 'className' = 'User', 'foreignKey' = 'sender', 'conditions' = 'User.id = Message.sender', 'fields' = '', 'order' =

Re: Message Model with Sender and Recipient from User-Table

2010-06-04 Thread nils
nah, doesn't work.. :/ Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To

Re: Message Model with Sender and Recipient from User-Table

2010-06-04 Thread Jeremy Burns
Actually, looking at this a bit more, I'd like to pose a few questions. The general way of relating one table to another twice is that you give each a different class name - in your case Sender and Recipient. You then do a normal join, specifying the class name (User in your case) of the

Re: Message Model with Sender and Recipient from User-Table

2010-06-04 Thread nils
Jeremy, thanks for the link, it was a bit buried in the depths of The Book, so I didn't find it at first. Will check there now.. - Initial test wasn't working, but I'll be getting there (I hope)! ;) cheers! nils On 4 Jun., 15:28, Jeremy Burns jeremybu...@me.com wrote: Actually, looking at