I would create a table, documents, that has the fields that all your file types require (eg. id, filename) and one each for your doc types (eg. text_docs, pdf_docs, etc.) and use something like InheritableBehavior [1].
You could also use ExtendableBehavior [2] and save everything to a single table. Personally, generally I prefer to do this sort of thing with separate tables, though. [1] http://bakery.cakephp.org/articles/view/inheritable-behavior-missing-link-of-cake-model [2] http://bakery.cakephp.org/articles/view/extendablebehavior On Sat, May 23, 2009 at 8:24 AM, marco.rizze...@gmail.com <marco.rizze...@gmail.com> wrote: > > Hi > My problem is about the project of the models of my web application > I have a model Document . The problem is that this model must have > dinamic data fields. > A document can have like fields : title .text , data > Another can have : title, number , attachment > ect... > This fields can have different type: some can be simple string, other > can be file , other can be text . > > Substantially for the moment I have create only the model Document but > I've no idea how to handle everything else > I really hope that someone can help me > Many thanks > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---