Remove member from group

If association does not exists, this will silently do nothing

@param int $groupId
@param int $userId
490660
public function removeMember($groupId, $userId)
    {
        $this
            ->database
            ->delete('ucms_group_access')
            ->condition('group_id', $groupId)
            ->condition('user_id', $userId)
            ->execute()
        ;

        // @todo dispatch event

        $this->touch($groupId);

        $this->resetCache();
    }
1067107
static public function create($groupId, $userId, $role)
    {
        $instance = new self();

        $instance->group_id = (int)$groupId;
        $instance->user_id = (int)$userId;
        $instance->role = (int)$role;

        return $instance;
    }
990655
public function deleteGroup($groupId)
    {
        try {
            return $this->innerGateway->deleteGroup($groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
327115
public function sendGroupsParticipantsRemove($groupId, $participant)
    {
        $msgId = $this->createMsgId();
        $this->sendGroupsChangeParticipants($groupId, $participant, 'remove', $msgId);
    }
546069
public function removeUsersFromGroup(Group $group, array $users)
    {
        foreach ($users as $user) {
            $group->removeUser($user);
            $this->eventDispatcher->dispatch('log', 'Log\LogGroupRemoveUser', array($group, $user));
        }

        $this->om->persist($group);
        $this->om->flush();
    }
1237757
public function removeUserGroups(UserGroup ...$groups)
    {
        foreach ($groups as $group) {
            $this->getUserGroups()->removeElement($group);
        }

        return $this;
    }
1024728
public function delete(Group $group, $userId = null)
    {
        $this->dispatch($group, 'preDelete', [], $userId);

        $this->database->delete('ucms_group')->condition('id', $group->getId())->execute();

        $this->dispatch($group, 'delete', [], $userId);
    }
53538
@Override
	public void removeByGroupId(long groupId) {
		for (CommerceCountry commerceCountry : findByGroupId(groupId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceCountry);
		}
	}
977443
public function changeGroup ($userOpenID, $groupID)
    {
        $failed = $this->changeAllGroups([$userOpenID], $groupID);

        if (count($failed) <= 0) {
            return true;
        }

        return false;
    }
755652
public function removeMemberFromGroup($memberId, $groupId)
    {
        $uri  = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/';
        $uri .= $this->getDomain() . '/' . $groupId . '/member/' . $memberId;

        return $this->delete($uri);
    }
1343810
public function removeByUserId($userId): void
    {
        $results = $this->findBy(['userId' => $userId]);

        foreach ($results as $result) {
            $this->getEntityManager()->remove($result);
        }

        $this->getEntityManager()->flush();
    }
389589
public function getGroupMember($groupId, $memberId)
	{
		return $this->sendRequest(
			$this->createRequest('GET', sprintf('groups/%d/members/%d', $groupId, $memberId))
		);
	}
447892
public function deleteGroup($groupId)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_GROUP_DELETE_PREFIX, [
            'group_id' => $groupId
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
882285
protected static function delete_user_data($userid) {
        global $DB;
        $DB->delete_records_select('messageinbound_messagelist', 'userid = :userid', ['userid' => $userid]);
        \core_userkey\privacy\provider::delete_userkeys('messageinbound_handler', $userid);
    }
991194
@Override
	public void removeByGroupId(long groupId) {
		for (CPRule cpRule : findByGroupId(groupId, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(cpRule);
		}
	}
346303
public function removeGroupAction(Request $request, $groupId)
    {
        $format = $request->get('_format', 'json');

        $facade = $this->get('jms_serializer')->deserialize(
            $request->getContent(),
            $this->getParameter('open_orchestra_user_admin.facade.user.class'),
            $format
        );
        $user = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('user', $facade);
        if (!$user instanceof UserInterface) {
            throw new UserNotFoundHttpException();
        }
        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $user);

        $this->get('open_orchestra_user.repository.user')->removeGroup($user->getId(), $groupId);

        return array();
    }
961693
public function removeParticipant($userId)
    {
        $userIds = is_array($userId) ? $userId : (array) func_get_args();

        Models::participant()->where('thread_id', $this->id)->whereIn('user_id', $userIds)->delete();
    }