I am trying to build a simple hierarchy of two node types. A-type is the parent and B-type is the child. I am also trying to strictly enforce that hierarchy, i.e.:
1) a B-node cannot be created without specifying a parent A-node
2) when an A-node is deleted, all child B-nodes MUST be deleted (with an appropriate warning of course)
I added a nodereference field to my B-type that references the A-type and made that fileld mandatory. This automatically solves my 1st requirement. My questions is: how to enforce my 2nd requirement to delete all referencing child nodes when a referenced parent node is deleted? I searched long but couldn't find a module that does that. What is the best way to accomplish this? Any modules/code snippets?
Thanks!