This is my team model. Once I change TeamUser to TeamsUser it works
correctly, but that shouldnt be. Based on the docs and naming
convention it should be TeamUser.

class Team extends AppModel {

        /**
         * Teams belong to a country, state
         */
        var $belongsTo = array('Country', 'State');

        /**
         * Team has many members and games
         */
        var $hasAndBelongsToMany = array(
                'Leader' => array(
                        'className'                             => 'User',
                        'fields'                                => 
array('Leader.id', 'Leader.username',
'Leader.handle', 'Leader.avatar'),
                        'conditions'                    => 
array('TeamUser.role' => 'leader'),
                        'foreignKey'                    => 'team_id',
                        'associationForeignKey' => 'user_id'
                ),
                'Players' => array(
                        'className'                             => 'User',
                        'fields'                                => 
array('Players.id', 'Players.username',
'Players.handle', 'Players.avatar'),
                        'conditions'                    => array('TeamUser.role 
!=' => 'leader',
'TeamUser.status' => 'approved'),
                        'foreignKey'                    => 'team_id',
                        'associationForeignKey' => 'user_id'
                ),
                'Games' => array(
                        'className'                             => 'GameSystem',
                        'foreignKey'                    => 'team_id',
                        'associationForeignKey' => 'game_system_id'
                )
        );
}
--~--~---------~--~----~------------~-------~--~----~
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