Doctrine2 + soft delete as status template

Doctrine2 docs says soft deletion behavior should be better implemented as a state template. But it does not provide any example of this implementation.

How to achieve soft deletion using a state template?

+6
source share
1 answer

I think they reference filters that are available since version 2.2:

The functionality of the filter works at the SQL level. Is the SQL query generated in Persist, during lazy loading, in additional lazy collections, or from DQL. Each time the system iterates over all enabled filters, adding a new part of SQL as a filter.

The DoctrineExtensions library includes "soft-delete" behavior . You can look at their implementation to see how it works in detail.

+3
source

Source: https://habr.com/ru/post/908883/


All Articles