Le 17/10/2017 à 13:52, Nima Sadjadi a écrit :
I tried orphanRemoval but it deletes Department too when I delete Admin. But I 
just wanted to delete what is in join table when I delete Admin. When I delete 
deparment it works fine.

The default behavior of the ManyToMany relationship is to cascade removal to the join table. So you don't need to do anything special to get the behavior you describe here.

I think your issue is due to the fact that you configure columns for the join table explicitly instead of using the default behavior, and so you end up with a non-default configuration (which would not have the ON DELETE CASCADE)

--
Christophe | Stof

--
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to