Search code examples
symfonysonata-admin

How to full delete in Sonata Admin (one to many relation)


Iam using Sonata Admin. Have a House and Room entitys with one to many relation. Iam use the CollectionType field for relation.

If i check delete, when edit a list of rooms and press Save - it set null relation field house_id in room table, but record still not delete.

How to fix this? Thx.


Solution

  • Give to Relation field

    Cascade ={"remove"}, orphanRemoval=true