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".

On Oct 7, 11:29 pm, Adwin  Wijaya <[EMAIL PROTECTED]> wrote:
> you can add product_id so that the image only belongs to the one
> product.
>
> Btw, how about to combine the product and image into one table ?
> I used to make as one table instead of doing one on one relationship.
> (less query .. i think)
> cmiiw
>
> adwinwww.wysmedia.com


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