Is there a reason for roles to get persisted as an extra object or should I just save them as an array in the $roles
property of my User
entity?
It depends. If you don't need to do special queries based on roles and/or don't mind locking yourself to a particular database vendor supporting arrays, persisting as an array will do.
security.yml
config file and will just persist the users' roles in an array or something else - Elnur Abdurrakhimov 2012-04-05 17:02