src/CRUDlex/UserProvider.php
protected function loadUserRolesViaManyToMany($user)
    {
        $roles = ['ROLE_USER'];
        if (is_string($this->userRoleIdentifier)) {
            foreach ($user->get($this->userRoleIdentifier) as $role) {
                $roles[] = $role['name'];
            }
        }
        return $roles;
    }
protected function loadUserRolesViaManyToMany($user)
    {
        $roles = ['ROLE_USER'];
        if (is_string($this->userRoleIdentifier)) {
            foreach ($user->get($this->userRoleIdentifier) as $role) {
                $roles[] = $role['name'];
            }
        }
        return $roles;
    }
protected function loadUserRolesViaManyToMany ( $ user ) { $ roles = [ 'ROLE_USER' ] ; if ( is_string ( $ this -> userRoleIdentifier ) ) { foreach ( $ user -> get ( $ this -> userRoleIdentifier ) as $ role ) { $ roles [ ] = $ role [ 'name' ] ; } } return $ roles ; }
Loads the roles of an user via a many-to-many relationship

@param Entity $user
the id of the user

@return string[]
the roles of the user
Loads the roles of an user via a many - to - many relationship