Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

subs model

By: a guest on Feb 16th, 2011  |  syntax: PHP  |  size: 0.68 KB  |  views: 68  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /*
  3.  * To change this template, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. /**
  8.  * Description of User
  9.  *
  10.  * @author david
  11.  */
  12. class User extends AppModel {
  13.         var $name = 'User';
  14. var $actsAs = array('Containable');
  15.   //  var $hasMany = array();
  16.     var $hasAndBelongsToMany =
  17.         array(
  18.             'Subscription' =>
  19.                 array('className'=>'Subscription',
  20.                     'joinTable' => 'users_subscriptions',
  21.                     'foreignKey'             => 'user_id',
  22.                    'associationForeignKey'  => 'subscription_id',
  23.                     'unique' => true,
  24.                    )
  25.             );
  26.  
  27.  
  28. }
  29. ?>