You want a self join. Try something along these lines:

class FriendOfFriend extends AppModel {

        public $name = 'FriendOfFriend';
        
        public $belongsTo = array(
                'User' => array(
                        'className' => 'User',
                        'foreignKey' => 'user_id'
                )
        );
        
        public $hasMany = array(
                'Friend' => array(
                        'className' => 'Friend',
                        'foreignKey' => 'friend_id'
                )
        );
}

public $paginate = array(
        'Friend' => array(
                'limit' => 10,
                'order' => array('Friend.requestTime' => 'ASC'),
                'recursive' => 2,
                'contain' => array(
                        'FriendOfFriend' => array(
                                'User' => array(
                                        'Country'
                                )
                        )
                        
                )
        )
);


On Thu, Jan 8, 2009 at 6:17 PM, Miles J <[email protected]> wrote:
>
> Anyone have an idea on this?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to