Symfony login authentication returning Error: Call to a member function toArray() on a non-object
问题 I am working on a website that is built using symfony 2.5, the requirement was that each user needs to have a only one role (user cannot have more than 1 role) so in users table where the username and passwords go there is another column by the name role which holds ROLE_ADMIN for admin people and ROLE_STAFF for company staff, so while authenticating if my getRoles function looks like the following i am able to login just fine as an admin public function getRoles() { return array('ROLE_ADMIN'