is there a best practice, to ask the user before deleting an item (domain model)?
I want to implement something like: "Do you really want to delete user “Klaus”? (Yes/Cancel)
Of course one can use some JS triggered by a click, making a little form visible, which contains the link to actionDelete() …
I think in FLOW there should be a simple elegant way to do so!
If you are running the risk of deleting a project, where lots of people and lots of money are involved, I shurely want to have a warning.
We probably install a special user, with the licence to kill.
So, if I got you right, there is nothing prefabricated. I think a framework like flow should provide a solution for this “standard problem”.
To make a detele undoable sounds intersting to me. Do you know where to look for details?
I think a framework like flow should provide a solution for this “standard problem”.
I’m not so sure about that, because this can be implemented in very different ways depending on the application. Doing a client side popup is just one of dozens ways and providing a opinionated solution in that case is IMO counter-productive (apart from Flow not providing any client-side solutions anyway).
To make a detele undoable sounds intersting to me. Do you know where to look for details?
If you want anything usable out-of-the-box, take a look at the Gedmo Doctrine extensions:
The suggested solution to use an AuditLog is probably the best solution to have recoverable deletes in your application, but it’s also a bit more complex to implement. You could also use a Gedmo extension for this, which basically versions your entity and keeps a history of it in a separate table:
The bonus with this is, that you can not only undo deletes, but basically undo any change done on the entity.