Sorry for the generic title, but don't find any better one to describe my situation, that I describe next.
I'm working on a project that requires to create a Project that have various Subprojects associated. I created a Project entity and a Subproject one. Now, there are more than one kinds of subprojects but all of them share most of the properties, so I created the subproject entity in such a way that the differences are stored in a Options field. So, each project will have the common fields + an array of options in the options field.
When it comes to create the form to enter the data though, I want to render the independent fields that the user can fill out for each Subproject (it's only one big form with the main project and subprojects fields to fill).
Then, when the user submits the data, I want to take the fields that are "different" in each subproject and put them in the options field.
[EDIT]To make it more clear, I have a Project, and then a Platform 1 subproject, a platform 2 subproject and so on. Platform 1 subproject can have the common subproject fields + my_custom field 1; then Platform 2 subproject would have common fields + my_custom field 2. Now, when I will store the subprojects, I will put them in Subproject table, where I fill out the common fields and then the fields that difer (in concept, amount or whatever) I store in options field. Each subproject, then will have an options field with a particular formatted data on it. That been said, each form for each subproject will slightly difer from the rest.[EDIT]
This is the question then: How can I create such a form that includes forms for specific subprojects, and then transform those "different" fields into one only options field. Do I need to create a FormType for each subproject type? If yes, then do I need to create an Entity (not persistable) for each of those subprojects types?
Please, if you don't understand ask me and I will try to answer any question to clarify this. Don't include code because I didn't think is necessary, but if you think it is, please, let me know. I have read the DataTransformers section in Symfony book, and Embedded forms, so pointing in that direction will not help me that much. Nevertheless, if you have a practical insight on how can I use those things to achieve what I want, your advice is more than welcome.
Some questions in SO address this topic for simple fields, but don't provide the answers I'm looking for.
Any clue is appreciated. Thanks in advance.