You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed the same issue. The root cause in my case was two folds.
the postLoad() event handler was relying on getEntity() to check if this is the entity that interests it (e.g. containing the Encrypted annotation). But as you've experienced, on associated entity, Doctrine lazy loads it and wrap the entity inside a proxy class, which then fails the getEntity() match.
Second problem is on Doctrine, the postLoad() triggers even before the associated entity is hydrated, thus even if the getEntity() can somehow match it, the entity is still empty.
We need to find a better binding/listener hook implementation different to how it's currently done.
I have fixed this issue in my fork https://github.com/ambta/DoctrineEncryptBundle. This by checking on relationships in the entity and use the get method to recursively processes that entity as well. I also changed it a little by using postUpdate and preUpdate because there were some issues in different occasions using the prePersist. The proxy classes issue can easily be fixed by using getClass from Doctrine's ClassUtils. Everything works like charm in the setups i used in in so far.
When accessing decrypted column in a join, or when selecting manually, it will return the raw encrypted data.
i'm using the annotation
Works like a charm
AND
wont work
The text was updated successfully, but these errors were encountered: