Doesn't CakePHP 1.2 support additional fields in a HABTM table?

David

On Jan 21, 6:15 pm, Ponderosa - Lists
<[EMAIL PROTECTED]> wrote:
> Your colors_shirts_sizes table should be a new table/model inventory.
>
> Inventory
> - id
> - shirt_id
> - size_id
> - color_id
> - inventory_qty
> ... any other inventory information needed such as location etc.
>
> As soon as you need more than just the cross reference id's in the table
> (like your inventory quantity) it needs to be its own model.
>
> Danielle
>
> -----Original Message-----
> From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> Of david_setwise
> Sent: January 21, 2008 3:03 PM
> To: Cake PHP
> Subject: Connecting Two HABTM Tables
>
> Here is a potential situation in which it seems like two HABTM tables
> should be connected.  So, am I incorrect in my table structure.  If
> not, can Cake handle connecting two HABTM tables?
>
> The system in question deals with clothing.  So imagine shirts of
> various types that can have multiple sizes and colors, with the
> ability to track inventory.
>
> The first HABTM is fairly straight forward: Colors > Colors_Shirts >
> Shirts
>
> But if I want to add in sizes, with an inventory for each combination
> (Plain T-shirt, Green, Size Medium, inventory 20) it get complicated.
> I envision the correct database structure/relationship as having the
> Sizes table connected to the Colors_Shirts table with a HABTM
> relationship, in which the inventory is stored.
>
> Colors_Shirts > Colors_Shirts_Sizes (with field for inventory) > Sizes
>
> So, is this the way you would structure the database?  If so, can Cake
> handle such a relationship?  And if not, does anyone have a decent
> alternative?
>
> Colors
>  - color_id
>  - name
>
> Shirts
>  - shirt_id
>  - name
>  - description
>
> Sizes
>  - size_id
>  - shortCode
>
> Colors_Shirts
>  - color_id
>  - shirt_id
>
> Colors_Shirts_Sizes
>  - color_id
>  - shirt_id
>  - size_id
>  - inventory

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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