public function getGroupRoles()
    {
        $roles = [];

        foreach ($this->groups as $group) {
            foreach ($group->getEntityRoles() as $role) {
                if (!in_array($role, $roles)) {
                    $roles[] = $role;
                }
            }
        }

        return $roles;
    }
public function getGroupRoles()
    {
        $roles = [];

        foreach ($this->groups as $group) {
            foreach ($group->getEntityRoles() as $role) {
                if (!in_array($role, $roles)) {
                    $roles[] = $role;
                }
            }
        }

        return $roles;
    }
public function getGroupRoles ( ) { $ roles = [ ] ; foreach ( $ this -> groups as $ group ) { foreach ( $ group -> getEntityRoles ( ) as $ role ) { if ( ! in_array ( $ role , $ roles ) ) { $ roles [ ] = $ role ; } } } return $ roles ; }
Returns the roles owned by groups the user is a member.

@return Role[]
Returns the roles owned by groups the user is a member .