TWIOF wrote:
> I'm using one db table for all images (there won't be that many
> over all) - so can i have a hasOne and add a condition to only pick
> thumbs, and a hasMany with a condition only to pick illustrations.

I don't see why you need to use a separate hasOne. I think you could
just use one hasMany relationship for both thumbnails and
illustrations. You can apply an additional condition (WHERE clause) to
distinguish between the two different categories of image. Just because
there is a hasMany relationship, doesn't mean there MUST be many in any
given situation. For example, a particular invoice can have just one
item.

Likewise, for invoices with more than one item, I can perfectly well
ask for a list of all the items on a given invoice that happen to be,
say, labor charges. If there is at most one labor charge per invoice, I
just get a list of one item -- the labor charge for that invoice.

Similarly with the thumbnails -- you just happen to have one thumbnail
for each item, and maybe multiple illustrations.

(Somebody please correct me if I'm wrong!)


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