Remove participants from thread.

@param array|mixed $userId

@return void
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();
    }
1189051
public function remove($itemId)
    {
        $items = &$this->items;

        foreach ($items as $position => $item) {
            if ($itemId === $item->id) {
                unset($items[$position]);
            }
        }
    }
969799
public function hasParticipant($userId)
    {
        $participants = $this->participants()->where('user_id', '=', $userId);
        if ($participants->count() > 0) {
            return true;
        }

        return false;
    }
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);
    }
175820
public function deleteRating($userId, $ratingId)
    {
        $rating = $this->getRatingById($ratingId);

        $this->validateUserPermissionsToManageRating($rating, $userId);

        $rating = $this->disableSubShopDeleteProtectionForRating($rating);
        $rating->delete();
    }
183292
public function delete($id)
    {
        $this->loadModel('User.Users');
        $user = $this->Users->get($id, ['contain' => ['Roles']]);

        if (in_array(ROLE_ID_ADMINISTRATOR, $user->role_ids) &&
            $this->Users->countAdministrators() === 1
        ) {
            $this->Flash->danger(__d('user', 'You cannot remove this user as it is the last administrator available.'));
        } else {
            if ($this->Users->delete($user)) {
                NotificationManager::canceled($user)->send();
                $this->Flash->success(__d('user', 'User successfully removed!'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('user', 'User could not be removed.'));
            }
        }

        $this->title(__d('user', 'Remove User Account'));
        $this->redirect($this->referer());
    }
563509
public function removeMembersFromGroupConversation($groupConversationId, array $users)
    {
        $group = $this->find($groupConversationId);

        if ($group) {
            $group->users()->detach($users);

            return true;
        }

        return false;
    }
638126
public function unassignAllRoles($userId)
    {
        $user = $this->model->find($userId);
        $user->roles()->detach();
    }
1236864
public function isUnread($userId)
    {
        try {
            $participant = $this->getParticipantFromUser($userId);
            if ($this->updated_at > $participant->last_read) {
                return true;
            }
        } catch (ModelNotFoundException $e) {
            // do nothing
        }

        return false;
    }
1111642
public void removeLocks(CmsUUID userId) {

        Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator();
        while (itLocks.hasNext()) {
            CmsLock currentLock = itLocks.next();
            boolean editLock = currentLock.getEditionLock().getUserId().equals(userId);
            boolean sysLock = currentLock.getSystemLock().getUserId().equals(userId);
            if (editLock) {
                unlockResource(currentLock.getResourceName(), false);
            }
            if (sysLock) {
                unlockResource(currentLock.getResourceName(), true);
            }
        }
    }
1099217
private function cleanBatches($userId)
    {
        $where = EBatch::A_USER_REF . '=' . (int)$userId;
        $result = $this->daoBatch->delete($where);
        return $result;
    }
675821
public function deleteUser($userId)
    {
        $result = $this->httpGet(self::WECHAT_USER_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'userid' => $userId
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
1080757
public function handleOpen(int $userId) : void
    {
        if ($this->presenter->isAjax())
        {
            if (!$this->presenter->user->isAllowed(UserAuthorizator::RES_REMOVE_HANDLE))
            {
                throw new ForbiddenRequestException;
            }

            $this->userEntity = $this->userRepository->findOneById($userId);

            $this->presenter->handleModalToggle('show', '#wakers_user_remove_modal', FALSE);
            $this->onOpen();
        }
    }
384784
public function participantsUserIds($userId = null)
    {
        $users = $this->participants()->lists('user_id');

        if ($userId) {
            $users[] = $userId;
        }

        return $users;
    }
867041
protected function empty_queue(int $userid, int $timemodified) : void {
        global $DB;

        $DB->delete_records_select('forum_queue', "userid = :userid AND timemodified < :timemodified", [
                'userid' => $userid,
                'timemodified' => $timemodified,
            ]);
    }
78150
public static function removeById(int $id) {
		if ($user = R::findOne('user', ' id = ? ', [$id])) {
			R::trash($user);
		}
	}
918521
public function deleteAllItemsByUser($userId)
    {
        if (empty($userId)) {
            return [];
        }

        $command = \Yii::$app->getDb()->createCommand();
        $command->delete($this->assignmentTable, 'user_id = :user_id', ['user_id' => $userId]);
        return $command->execute();
    }