sonata-project/SonataPageBundle — pull request #162 by sepetrov (2013-02-19 16:21:54+00:00)
Title: use Entity lifecycle events when disable old Snapshots

Hi,

This changes the way old/stale Snapshots are being deactivated. The old code was using PDO statements to update those records. The @todo comment suggested the use of DQL but both approaches, although efficient, would not make use of the Doctrine event system and the rest of the application would have no way of knowing when some entities have been disabled. This was a problem for me because I also use [FOQElasticaBundle](https://github.com/Exercise/FOQElasticaBundle) which has listeners to update the search index if that is necessary when you insert/update/delete an entity.

I hope it helps.

Cheers,
Stan