public function getRoles()
    {
        $roles = array();
        foreach ($this->groups as $group) {
            $roles[] = $group->getAsRole();
        }
        $roles[] = 'ROLE_USER';
        return $roles;
    }
public function getRoles()
    {
        $roles = array();
        foreach ($this->groups as $group) {
            $roles[] = $group->getAsRole();
        }
        $roles[] = 'ROLE_USER';
        return $roles;
    }
public function getRoles ( ) { $ roles = array ( ) ; foreach ( $ this -> groups as $ group ) { $ roles [ ] = $ group -> getAsRole ( ) ; } $ roles [ ] = 'ROLE_USER' ; return $ roles ; }
Get role objects

@return array
Get role objects