在将从数据库表中获取的每个字段上应用一个函数:cakePHP 3

I want to apply one function called htmlentities in every field which retrieve from table.

how can i do this? i have used beforeMarshal but its only affect while save data in database. its not affecting while retrieve data from database.

So is there any function in cakaPHP that i can make the functionality possible as above I don't want to write this function each and every place that i am retrieving I want global solution that i will change at one place and it will affect to every fetch data?

I want to apply htmlentities because to not affecting code from user like content <script>alert("u have hacked");</script>