I have three classes,
OrderAdmin, ProductAdmin, OrderHasEquipmentAdmin.
Order needs to add a Product and Equipment related to that product into an intermediate table OrderHasEquipment.
I can add a new Product, but when I try to add an OrderHasEquipment, it shows every Equipment I have in my DB, I only want to show the equipment available for that product and append to that Order.
Relations are
Order -> manyToOne -> Product
Order -> oneToMany -> OrderHasEquipment (because I need an intermediate Entity to work with sonata admin sonata_type_collection and sonata_type_model_list)
Product -> manyToMany -> Equipment
So, when creating/editing an Order, it shows up a choice list with Products, I need a behaviour that when a Product is selected, OrderHasEquipment (that is a sonata_type_collection field with sonata_type_model_list inside because the intermediate entity), allow me to only add an Equipment item related to that Product selected.
Any way of doing this?
->with('Relation table')stuff? - Robert W. Hunter