6

Doctrine2 docs said that soft-delete behavior should be better implemented as a State pattern But not provide any example of that implementation.

How to achieve soft delete behavior using a state pattern?

jaco0646
  • 15,303
  • 7
  • 59
  • 83
canni
  • 5,737
  • 9
  • 46
  • 68

1 Answers1

3

I think they refer to filters which are available since version 2.2:

The filter functionality works on SQL level. Whether an SQL query is generated in a Persister, during lazy loading, in extra lazy collections or from DQL. Each time the system iterates over all the enabled filters, adding a new SQL part as a filter returns.

The DoctrineExtensions library includes a "soft-delete" behaviour. You might want to have a look at their implementation to see how it works in detail.

mbh
  • 982
  • 9
  • 12