What is Cascade Detach within Doctrine 2?
All in the title :)
I like to understand what is the Cascade Detach thing? I can understand what is a Cascade Remove or something.
Thank y开发者_JS百科ou
It's all about associations.
Lets say you have two classes Parent
and Child
with OneToMany
association between them. Cascading operation mean that if you are detaching/removing object at the owning side of the association, objects on inverse side are also detached/removed.
Note that this has nothing to do with SQL On delete/update cascade
, this applies only to PHP data model. But, of course, when it comes to flushing changes, entities that were removed from data model with cascade operations are removed from DB just as well as manually removed entities.
精彩评论