Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Rack extends AppModel
- {
- var $name = 'Rack';
- var $primaryKey = 'rack_id';
- var $hasAndBelongsToMany = array(
- 'Chart' =>
- array(
- 'className' => 'Chart',
- 'with' => 'ChartItem',
- 'associationForeignKey' => 'chart_id',
- 'foreignKey' => 'rack_id',
- 'unique' => true
- )
- }
- class Chart extends AppModel
- {
- var $name = 'Chart';
- var $primaryKey = 'chart_id';
- var $hasAndBelongsToMany = array(
- 'Rack' =>
- array(
- 'className' => 'Rack',
- 'with' => 'ChartItem',
- 'associationForeignKey' => 'rack_id',
- 'foreignKey' => 'chart_id',
- 'unique' => true
- ));
- }
- class ChartItem extends AppModel {
- var $name = 'ChartItem';
- var $useTable = 'chart_items';
- var $belongsTo = array('Chart', 'Rack');
- }
Add Comment
Please, Sign In to add comment