Cascade Delete

One of our requirement is that if a url content item is deleted, all the related content items to whose slots this url content item is added to, should also be deleted.

The way I was thinking to implement is to write an extension. Couple of issues I am running into:

a). Can we write an extension that is invoked when the action on the associated item is purge(delete)? If so, is it different from the post process?

b). Is there any API to purge content items?

thanks
Manvinder

Are you saying that you want all parent items of a child to be purged when the child is purged from the system?

For example:
Create Generic item A,
Create Generic item B,
Create Generic item C
Add item A to a slot on item B and a slot on item C,
Purge item A (which should also purge items B and C?)

If this is the case, what you’re asking for seems VERY dangerous and I’m not sure what the actual business need for that would be. Can you elaborate?