Hi,

I have a couple of tables which are not related through primary keys
and I don't know if and how I can get CakePHP to understand this
relation.

I have these tables:

Orders: id, item_id, itemtype_id, quantity
Items: id, name, colors
Itemtypes: id, name
Prices: id, itemtype_id, colors, price

As you can see the price depends on the item type and the colors and
therefore Prices combines Itemtypes (via itemtype_id) and Items (via
colors). I can easily associate prices with either of these 2 tables
with a belongsTo/hasOne/hasMany relation. But what I want is
associating Prices with Orders.

I can associate Items and Itemtypes with orders directly and would like
to use (pseudeoproperties) Orders.itemtype_id and Orders.item_id.colors
to get the matching row in Prices (there's only one).

Is there a way to do this?
Any help appreciated!

-- Daniel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to