douzhi3105 2015-08-30 21:16
浏览 6

子实体模式实现

I want to implement a system of category and their associated options in Symfony 2.

So a Category (example: car, Home) have categoryOption (example: date, color, size, etc…).

Moreover, the Category entities have many to one relationship with the advert entity. I mean an Advert can have only one Category but infinite Advert can be attached to a Category. So, at the end, I want to be able to make a dynamic form like that:

enter image description here

If I select a category (ex: caravanning), all of the attached subcategory will appear like that:

enter image description here

And allow the user to select or enter the desired information.

I already have implemented the Category and Advert entity but I don’t know what schema to use for the options and how to generate the form. Do I have to create a new categoryOption entity and make a relationship with Advert and Category or use another way?

Of course, the categoryOption attached to the advert can be edited by the user.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?