php - CakePHP - Additional field on Model to display list of roles
I need a field in a model (specifically, it is a "User" model), that will list me all the Roles (ARO) as a delimited string (e.g. "Admin, Officer"). However, that field would be a read-only field, which could be used directly on the view.
This is what i have now:
["id"]=> "1" ["username"]=> "[email protected]" ["password"]=> "d1266f045175f0863dfe26d8bdfd9f91f4ca53bb" ["role_id"]=> "0"
The role_id refers to a ARO role. I would like to have a read-only, view specific field to contain the list of roles.
How to do this properly?