How would one set up this model association?

2011-01-26 Thread Chillwabbitt
Hi I have three tables all linked to one lookup table like so:

+-
+
 | AUXProductOption |
+
+---
+
| id | productOptionName|
+
+---
+
|  1 | Death, Total and Permanent Disability, Tempor|
|  5 | total,
540   |
|  6 | test fixed amount
|
+
+---
+

+-
+
 | AUXProductOptionFields|
+
+---
+
| id|
name |
+
+---
+
|  1   | Test
Field|
+
+---
+

+-
+
 | AUXProductOptionFieldValue  |
+
+---
+
| id|
value  |
+
+---
+
|  1   |
1001   |
|  2   | This is rover calling back huston   |
+
+---
+

+---
+
 |
AUXProductOption_has_AUXProductOptionFields
|
+---
+
| AUXProductOption_id | AUXProductOptionFields_id |
AUXProductOptionFieldValue_id   |
+
+-
+---+
|   1|
1| 1
|
|   1|
1| 2
|
|   5|
1| 2
|
|   6|
1| 1
|
+---
+--
+---+

my models look like so :
[CODE]
class AUXProductOption extends AppModel {
var $name = 'AUXProductOption';
var $useTable = 'AUXProductOption';
var $displayField = 'productOptionName';
//The Associations below have been created with all possible keys,
those that are not needed can be removed

var $hasAndBelongsToMany = array(
'AUXProductOptionField' = array(
'className' = 'AUXProductOptionField',
'joinTable' = 
'AUXProductOption_has_AUXProductOptionFields',
'foreignKey' = 'AUXProductOptionFields_id',
'associationForeignKey' = 'AUXProductOption_id',
'unique' = true,
'conditions' = '',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'finderQuery' = '',
'deleteQuery' = '',
'insertQuery' = ''
),
'AUXProductOptionFieldValue' = array(
'className' = 'AUXProductOptionFieldValue',
'joinTable' = 
'AUXProductOption_has_AUXProductOptionFields',
'foreignKey' = 'AUXProductOptionFieldValue_id',
'associationForeignKey' = 'AUXProductOption_id',
'unique' = true,
'conditions' = '',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'finderQuery' = '',
'deleteQuery' = '',
'insertQuery' = ''
)
);

}

class AUXProductOptionField extends AppModel {
var $name = 'AUXProductOptionField';
var $useTable = 'AUXProductOptionFields';
var $displayField = 'name';

var $hasAndBelongsToMany = array(
'AUXProductOptionFieldValue' = array(

Re: How would one set up this model association?

2011-01-26 Thread Chillwabbitt
OK forget that here's a picture
http://i29.photobucket.com/albums/c297/Chillwabbitt/junk/Screenshot.png

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php