开发者

Doctrine - encryption with dql listeners

开发者 https://www.devze.com 2023-01-20 22:23 出处:网络
I am attempting to encrypt certain database fields by adding a call to mysql AES_ENCRYPT (and AES_DECRYPT) using Doctrine DQL Hooks.

I am attempting to encrypt certain database fields by adding a call to mysql AES_ENCRYPT (and AES_DECRYPT) using Doctrine DQL Hooks.

for SQL SELECT's I have a preDqlSelect() in my Doctrine_Record_Li开发者_如何学Gostener class, which goes through each parameter in the select fields, and adds a AES_DECRYPT() for encrypted fields.

But, it looks like calling save() on a doctrine model class only calls the preSave() listener and does not call any of the preDql* listeners.

Can anyone suggest a way of getting this to work or a better way of doing this?

Thanks


In order for these dql callbacks to be checked, you must explicitly turn them on. Because this adds a small amount of overhead for each query, it is off by default

$manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true);

Doctrine 1.2 Event listeners

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号