I have two entities: Specialisation and Course. One specialisation has many courses, so relations are "OneToMany" and "ManyToOne".
I want to create specialisations and courses separately and then attach many courses to specialisation through multiple select. And I also need to remove(detach) courses from specialisation but without deleting courses-entities. So, I did it such way:
->add('courses', 'sonata_type_model', [
'multiple' => true,
'property' => 'title',
])
But when I remove related course from select-field in specialisation-edit -page, course-object deleting from DB too. I tried to remove orphanRemoval property from relation, but then when I try to detach courses from specialisation, nothing happens.
So, my question is: How I can achieve only detaching child-entities from parent-entity in SonataAdminBundle?