i know questions relating to this are posted ad infinitum on this
forum - i have searched high and low, far and wide but i have hit the
"proverbial" - i am going to post this and walk away for a while, and
in the meantime some generous soul might shed some light....here
goes.........
I have product datasheets which consist of tables such as the
following;
Ingredients CAS No Proportion TWA mg/m3 STEL mg/m3
Amoxycillin 61336-70-7 30-60% not set not set
hazardous NA to 100% NA NA
Each product is composed of 1 or more ingredients - each ingredient
can belong to one or more products.
Presently i have a;
1. Datasheet model/table
2. Ingredient model/table (includes a cas no. field)
3. Proportion model/table
4. TWA model/table
5. STEL model/table
I have also defined a habtm between ingredients and datasheets
( datasheets_ingredients).
table:
id | datasheet_id | ingredient_id
1 5 89
i also need to link the other three models in a habtm relation with
datasheets_ingredients because each field (proportion,twa,stel) are
dependent on the combined fields of datasheet_id and ingredients_id.
For clarity, i cannot select a "proportion" field until i know both
the datasheet id and the ingredient id - i cannot select the
proportion field(or twa ,stel) with one or the other it must be both
fields.
I have attempted multiple habtm tables ie using the above as an
example
table: datasheet_ingredient_proportion
id | datasheet_ingredient_id | proportion_id
1 1 6
this did not work.
I tried a habtm datasheets_ingredients tabel and also included foreign
key fields;
using the datasheets_ingredients model and adding a belongsTo
association with the three models and including a hasMany association
in their models - to no avail
table:
id | datasheet_id | ingredient_id | proportion_id | twa_id | stel_id
1 5 89
12 8 3
I have also read numerous other posts which have proved useful but i
cannot seem to crack it - i can get the result i need with handwritten
sql - but i would rather attack it using cakes process.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment