An alternate approach to https://github.com/michaeldegroot/DoctrineEncryptBundle
The bundle is more elegant and "feels" more Doctrine, as you simply add an annotation to the entities. However, because the property that is tracked by Doctrine is modified by the decryption, Doctrine sees changes when there are none: absolute-quantum/DoctrineEncryptBundle#25 Rather than digging deeper into the Doctrine internals, with the potential of side effects, this approach is very explicit and Doctrine does not really need to know about encryption/decryption at all.
looking at absolute-quantum/DoctrineEncryptBundle#35, we should also listen to onFlush, as preFlush is missing cascading inserts and would lead to not explicitly persisted but cascading inserts not be encrypted.