Advertisement
Guest User

subs model

a guest
Feb 16th, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | None | 0 0
  1. <?php
  2. class Subscription extends AppModel {
  3.     var $name = 'Subscription';
  4.         var $hasAndBelongsToMany = array(
  5.             'User'=>array('className'=>'User',
  6.                         'joinTable' => 'users_subscriptions',
  7.             'foreignKey' => 'subscription_id',
  8.             'associationForeignKey' => 'user_id',
  9.             'unique' => true));
  10.  
  11.        
  12. //  var $displayField = 'title';
  13. //  var $validate = array(
  14. //      'subID' => array(
  15. //          'numeric' => array(
  16. //              'rule' => array('numeric'),
  17. //              //'message' => 'Your custom message here',
  18. //              //'allowEmpty' => false,
  19. //              //'required' => false,
  20. //              //'last' => false, // Stop validation after this rule
  21. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  22. //          ),
  23. //      ),
  24. //      'title' => array(
  25. //          'notempty' => array(
  26. //              'rule' => array('notempty'),
  27. //              //'message' => 'Your custom message here',
  28. //              //'allowEmpty' => false,
  29. //              //'required' => false,
  30. //              //'last' => false, // Stop validation after this rule
  31. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  32. //          ),
  33. //          'alphanumeric' => array(
  34. //              'rule' => array('alphanumeric'),
  35. //              //'message' => 'Your custom message here',
  36. //              //'allowEmpty' => false,
  37. //              //'required' => false,
  38. //              //'last' => false, // Stop validation after this rule
  39. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  40. //          ),
  41. //          'maxlength' => array(
  42. //              'rule' => array('maxlength'),
  43. //              //'message' => 'Your custom message here',
  44. //              //'allowEmpty' => false,
  45. //              //'required' => false,
  46. //              //'last' => false, // Stop validation after this rule
  47. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  48. //          ),
  49. //      ),
  50. //      'price' => array(
  51. //          'money' => array(
  52. //              'rule' => array('money'),
  53. //              //'message' => 'Your custom message here',
  54. //              //'allowEmpty' => false,
  55. //              //'required' => false,
  56. //              //'last' => false, // Stop validation after this rule
  57. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  58. //          ),
  59. //          'notempty' => array(
  60. //              'rule' => array('notempty'),
  61. //              //'message' => 'Your custom message here',
  62. //              //'allowEmpty' => false,
  63. //              //'required' => false,
  64. //              //'last' => false, // Stop validation after this rule
  65. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  66. //          ),
  67. //      ),
  68. //      'subscribers_count' => array(
  69. //          'numeric' => array(
  70. //              'rule' => array('numeric'),
  71. //              //'message' => 'Your custom message here',
  72. //              //'allowEmpty' => false,
  73. //              //'required' => false,
  74. //              //'last' => false, // Stop validation after this rule
  75. //              //'on' => 'create', // Limit validation to 'create' or 'update' operations
  76. //          ),
  77. //      ),
  78. //  );
  79. }
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement