CakePHP 3.0.0 Decrypt straight from DB


#1

I have a behavior setup that will encrypt certain fields within the model’s beforeSave event method. This is working as desired.

The problem I have is that i’d like to be able to pull the encrypted fields from the DB and have them decrypted at the earliest opportunity. Please can someone advise the best way to do this?


#2

CakePHP used to have an afterFind method, but according to the docs, this has been replaced with Modifying results with Map/Reduce features:

in previous versions of CakePHP there was an afterFind callback, this has been replaced with the Modifying Results with Map/Reduce features and entity constructors.