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(