I believe these are 2 cases:
1) User wants to delete an order: check if order has invoices.
a) yes -> ask for confirmation.
b) no -> goto (2a).
2) User confirms he/she wants to delete invoices along with the order.
a) delete (in which case you can use "cascade delete").
My advise is to implement 2 actions in the controller to handle these 2 cases.
So the cascade delete should be fine. Once the application knows it should
delete the order, it should delete the order alongs with any invoices.
PS: Excuse my "goto", I don't mean this literally :) (http://xkcd.com/292/)
--
Jasper N. Brouwer
(@jaspernbrouwer)
On 3 Mar 2014, at 14:59, EvidentHost <[email protected]> wrote:
> I am using cascade delete, when an order is deleted the invoices will be
> deleted too, but if invoices are deleted I want to ask user if they want
> transactions to be deleted too. Because may be they don't want to delete
> payment transactions on invoice delete. I guess for this case i should not
> use cascade deleting in entity file but should delete transactions manually?
> Or is there a trick to apply onDelete=cascade not on any deletion but in a
> user defined case?
--
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 http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.