src/Transfer/EzPlatform/Repository/Manager/UserManager.php
protected function unassignUserFromUserGroups(User $user, array $userGroups)
    {
        $existingUserGroups = $this->userService->loadUserGroupsOfUser($user);
        foreach ($existingUserGroups as $existingUserGroup) {
            if (!array_key_exists($existingUserGroup->id, $userGroups)) {
                $this->userService->unAssignUserFromUserGroup($user, $existingUserGroup);
            }
        }
    }
protected function unassignUserFromUserGroups(User $user, array $userGroups)
    {
        $existingUserGroups = $this->userService->loadUserGroupsOfUser($user);
        foreach ($existingUserGroups as $existingUserGroup) {
            if (!array_key_exists($existingUserGroup->id, $userGroups)) {
                $this->userService->unAssignUserFromUserGroup($user, $existingUserGroup);
            }
        }
    }
protected function unassignUserFromUserGroups ( User $ user , array $ userGroups ) { $ existingUserGroups = $ this -> userService -> loadUserGroupsOfUser ( $ user ) ; foreach ( $ existingUserGroups as $ existingUserGroup ) { if ( ! array_key_exists ( $ existingUserGroup -> id , $ userGroups ) ) { $ this -> userService -> unAssignUserFromUserGroup ( $ user , $ existingUserGroup ) ; } } }
Unassigns a collection of eZ UserGroups from an eZ User.

@param User        $user
@param UserGroup[] $userGroups
Unassigns a collection of eZ UserGroups from an eZ User .