How can I add a user to a role .. for each new user, I need to do:
$em->getRepository('MyBundle:Role')->findOneBy(array('name' => 'ROLE_USER'))
everytime?
I'm not too a fan of how big UserBundle is .... and I don't use XML. I use YML / Annotations, so UserBundle is pretty hard to follow certain things.
So what is the best / cleanest way to create a user account and associate it with a default role?
source
share