Details
Description
Let's assume we have an Entity class "ParentClass", which uses a single table inheritance with child classes "ChildOne" and "ChildTwo".
"ParentClass" also have one-to-one unidirectional association with "FooBar" class named "foobar", and a self-referencing association called "parent"
We construct entity of "ChildOne" type, filling "foobar" link with new FooBar object. The same action is made for entity of "ChildTwo" type.
Entity of "ChildOne" type is persisted and flushed.
At this point getCommitOrder builds a commit order. ChildOne <---> FooBar link appears in dependency graph because of "foobar" association.
While processing assocs it reveals "parent" assoc in parent class and builds following links in dependency graph:
ChildOne <---> ChildOne
ChildOne <---> ChildTwo
After that "ChildTwo" entity is persisted and flushed. At this point commit calculator thinks it already have "ChildTwo" in it's storage so no assoc calculation are made for "childTwo" class
If we attemp to delete "ChildTwo" class flush() will fail because of missing link "ChildTwo <-----> Foobar" assoc
I've opened pull request https://github.com/doctrine/doctrine2/pull/47 with my fix to this issue. I'm new to doctrine development so feel free to make any suggestions how to improve it