Advertisement
Guest User

Tournament Model

a guest
Sep 11th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2. class Tournament extends AppModel {
  3.     public $name = 'Tournament';
  4.    
  5.     public $belongsTo = array('Version');
  6.  
  7.     public $hasAndBelongsToMany = array(
  8.         'User' => array(
  9.             'className' => 'User',
  10.             'joinTable' => 'tournaments_users',
  11.             'foreignKey' => 'tournament_id',
  12.             'associationForeignKey' => 'user_id',
  13.             'with' => 'TournamentsUser'
  14.         ),
  15.         'Team' => array(
  16.             'className' => 'Team',
  17.             'joinTable' => 'tournaments_users',
  18.             'foreignKey' => 'tournament_id',
  19.             'associationForeignKey' => 'team_id',
  20.             'with' => 'TournamentsUser'
  21.         )
  22.     );
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement