If I've understood you correctly.... each document will have a number of different fields that would be useful to store in the database, but all documents are unique.
The first thing I would do is write down a list of every single possible field that you would need for these documents. If you think that some documents will share certain characteristics, you could make another table and have a few document templates that would fit your needs. E.g. one template has text, title and attachment, another is the same but does without the attachment. Alternatively you could just create one big table with all of the possible fields that you drew up and just make them optional. Obviously you would need some form of validation. You could set them as NULL in your mysql database (so they allow empty values), then draw up a validation rule that said documents must have at least 3 fields (for example). On May 23, 1:24 pm, "[email protected]" <[email protected]> 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 [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 -~----------~----~----~----~------~----~------~--~---
