Kaivosukeltaja
Kaivosukeltaja

Reputation: 15735

Deleting entities non-destructively in Symfony2

Is there a good, clean and simple way to delete entities non-destructively in Symfony 2? I'd like to give my administrators a chance to undelete items, while sacrificing as little of the automation provided by the framework as possible.

If there is no built-in solution or third party bundle to help me, what would be the best way to do this? Adding a deleted property to entities would require lots of added logic to keep them from cluttering the controllers created by doctrine:generate:crud, so maybe they should be stored in a separate table in serialized form?

Upvotes: 11

Views: 5715

Answers (1)

Elnur Abdurrakhimov
Elnur Abdurrakhimov

Reputation: 44851

What you want is Soft Delete. There is a Doctrine extension for that and a bundle to integrate it with Symfony.

Upvotes: 14

Related Questions