so your product should be:

Products
:id
:image_id

Images
:id
:product_id

Products  --> :hasOne image
Images -> :hasOne product

if a Image can be used by multiple products then the Images table
should :
Images
:id

Products
:id
:image_id

Products hasOne: image
Images belongsTo: product

CMIIW.


On Oct 8, 2:00 pm, andyreimer <[EMAIL PROTECTED]> wrote:
> Well it seems to work if I switch around the relationship.  If Product
> belongsTo Image, then that image record is available to me based on
> the presense of the image_id in the product table.  It doesn't really
> make sense to say that the product belongs to the image, but thats
> just the semantics that cake employs to say "I have a foreign key in
> this table, go to another table and get the related record with a
> matching primary key" vs. "I have a primary key, go to another table
> and find all records with a matching foreign key".


--~--~---------~--~----~------------~-------~--~----~
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