symfony - Big form collections with Symfony2 -
i'm having trouble big form in symfony2. let me explain situation:
a client of me offers one day courses , i'm building application participants can sign particular course. process simple: participant logs in, selects course, selects date , signs up.
this involves multiple entities:
- course, ~20 required properties, onetomany coursedate
- coursedate, ~1 required property, onetomany couredateparticipant
- coursedateparticipant, ~20 properties, manytoone participant
the properties of coursedateparticipant same als course, of them used override property of course in cases. of times majority of coursedateparticipants properties null.
in backend i'm having 1 form admin can add , edit whole course @ once. form similar entities i.e. coursetype collection of coursedatetype collection of coursedateparticipanttype.
everything working fine, except big courses. course can contain 50 coursedate, coursedate can contain 1000 coursedateparticipant. every property has own field, these numbers form contain 50*1000*20 = 1.000.000 fields. but, of these fields null.
i did jquery magic make ui usable. , when adding course filled fields submitted. when editing changed fields submitted.
but controller choking when calling $form->createview() such big numbers prefilled (when editing). solutions i'm thinking of:
- tell client split such big course in little ones. (not favorite)
- don't render coursedateparticpant on initialization, somehow afterwards if admin clicks button. can button render all, button each coursedateparticipant.
- remove many properties coursedateparticipant , save exceptions somewhere else.
do people have other/better suggestions?
Comments
Post a Comment