Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2. class Rack extends AppModel
  3. {
  4. var $name = 'Rack';
  5. var $primaryKey = 'rack_id';
  6. var $hasAndBelongsToMany = array(
  7. 'Chart' =>
  8. array(
  9. 'className' => 'Chart',
  10. 'with' => 'ChartItem',
  11. 'associationForeignKey' => 'chart_id',
  12. 'foreignKey' => 'rack_id',
  13. 'unique' => true
  14. )
  15. }
  16.  
  17. class Chart extends AppModel
  18. {
  19. var $name = 'Chart';
  20. var $primaryKey = 'chart_id';
  21. var $hasAndBelongsToMany = array(
  22. 'Rack' =>
  23. array(
  24. 'className' => 'Rack',
  25. 'with' => 'ChartItem',
  26. 'associationForeignKey' => 'rack_id',
  27. 'foreignKey' => 'chart_id',
  28. 'unique' => true
  29. ));
  30.  
  31.  
  32. }
  33.  
  34.  
  35.  
  36. class ChartItem extends AppModel {
  37. var $name = 'ChartItem';
  38. var $useTable = 'chart_items';
  39. var $belongsTo = array('Chart', 'Rack');
  40. }
Add Comment
Please, Sign In to add comment