On Jul 26, 2006, at 8:04 AM, Jeff B wrote:

>
> I'm starting a new application and I'm trying to figure out if Cake
> will help or hinder my development.  I ask this because the CRUD forms
> I will need are not based on the table schema, but on a virtual schema
> stored in the tables.  The attributes to collect for each item type is
> defined in a table:
>
> item_type_attributes (id, item_type_id, attribute_name,  
> attribute_type,
> required)
>
> Where the application would query to obtain the attributes that  
> need to
> be drawn in the CRUD forms.
>
> "select attribute_name, attribute_type from table where item_type=x"
>
> The data would be saved in another table:
>
> item_attributes (id, item_id, item_type_attribute_id, attribute_value)
>
> When drawing the update form, it would have to get the fields from the
> first table, and the values for the fields from the second table.
>
>> From what I know about models I have no idea how I would implement  
>> cake
> to handle the data this way. So I ask the experts, can cake handle  
> this
> or is it out of cake's reach?
>
> The reason for the design is that the data being collected have widly
> varying attributes as well as frequently changing attributes. and  
> if we
> used flatter tables the schema would be huge.

Having a hard time understanding the big picture: so you have items,  
which have attributes, and those attributes fall into certain types,  
right?

If so, you might just set up models for each of those, and associate  
them accordingly.

Item hasMany ItemAttribute
ItemTypeAttribute hasMany itemAttribute
itemAttribute belongsTo ItemTypeAttribute

This way when you call up a Item, you'll see its ItemAttributes,  
along with what ItemTypeAttribute each particular ItemAttribute  
belongs to.

I hope I understood you correctly...

-- John

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

Reply via email to