I've followed the Symfony2 Security documentation and have the entities, database and forms doing their thing. Trouble was I didn't have any users in my database so I completed the steps in the Registration Documentation, but in my opinion these should be better connected. The Registration docs say nothing about the roles. It seems to me the best time to assign a default role would be during the user registration. This is what I'm after but I'm a bit lost on how to do this considering the User Entity does not have any methods for adding roles. My question is how do I assign a default role ("ROLE_USER"), which is stored in the database, to users during registration?
Relevant Code:
User Entity: http://pastebin.com/zi8nWGb8
Role Entity: http://pastebin.com/Q8D5kB0A
UserRepository: http://pastebin.com/BLfAjgkt
Registration and Login Actions: http://pastebin.com/rdbAcBXu
The signupCreateAction is where I suspect the magic should happen or perhaps in the __construct() method of the user entity. I'm simply lost as to the correct way to do this.