Removes a preference from the cache by key and user

@param string|array $key One or more keys
@param int          $userId
760135
protected function pforget($key, $userId)
    {
        $keys = is_array($key) ? $key : [$key];

        foreach ($keys as $key) {
            $this->cache->forget($this->pkey($key, $userId));
        }

        $this->cache->forget($this->pkey('*', $userId));
    }
1309672
public function removeUserMetaKey( $user_meta_key ) {
		$filter = function( $meta_key ) use ( $user_meta_key ) {
			return $meta_key !== $user_meta_key;
		};
		$this->avatar_user_meta_keys = array_filter( $this->avatar_user_meta_keys, $filter );
	}
206271
public function remove($key) {
        if (isset($this->data->$key)) unset($this->data->$key);
        
        $this->store($this->data);
        
        return ;
    }
269811
public function remove($key)
    {
        $key = str_replace('_', '-', strtolower($key));

        unset($this->headers[$key]);

        if ('cache-control' === $key) {
            $this->cacheControl = array();
        }
    }
1370915
public function remove($criteria, $key)
    {
        if (isset($this->_data[$criteria]) &&
            is_array($this->_data[$criteria])) {
            unset($this->_data[$criteria][$key]);
            if (empty($this->_data[$criteria])) {
                unset($this->_data[$criteria]);
            }
        }
    }
1118892
public function forget($key)
    {
        if (array_key_exists($key, $this->settings)) {
            unset($this->settings[$key]);
        }
        $this->store();
    }
55849
public function dislikeToggle($userId = null)
    {
        app(LikeableServiceContract::class)->toggleLikeOf($this, LikeType::DISLIKE, $userId);
    }
284831
protected function pkey(string $key, $userId): string
    {
        return sprintf('%s(%s).%s', self::PREFERENCES_KEY_PREFIX, $userId, $key);
    }
916824
public function removeUser($userId)
    {
        if (true === is_numeric($userId) && true === in_array($userId, $this->users)) {
            foreach (array_keys($this->users, (int)$userId, true) as $key) {
                unset($this->users[$key]);
            }
        }
        return $this;
    }
539567
protected function process_remove_submission($userid = 0) {
        require_sesskey();

        if (!$userid) {
            $userid = required_param('userid', PARAM_INT);
        }

        return $this->remove_submission($userid);
    }
1135400
protected static function delete_data(\context $context, int $userid = null) {
        global $DB;

        $cohortids = $DB->get_fieldset_select('cohort', 'id', 'contextid = :contextid', ['contextid' => $context->id]);
        foreach ($cohortids as $cohortid) {
            $params = ['cohortid' => $cohortid];
            if (!empty($userid)) {
                $params['userid'] = $userid;
            }
            $DB->delete_records('cohort_members', $params);
        }
    }
1009844
public function deleteUser($userId)
    {
        try {
            return $this->innerGateway->deleteUser($userId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1014980
public function deleteUserLoginTokenFields($userID) {
        $user = $this->getFind($userID);

        $user->login_token            = '';
        $user->login_token_created_at = '';

        return $user->save();
    }
307717
public function release_lock($key, $ownerid) {
        if ($this->check_lock_state($key, $ownerid)) {
            return ($this->redis->del($key) !== false);
        }
        return false;
    }
789022
public function removeKey($key)
    {
        if (isset($this->values[$key])) {
            unset($this->values[$key]);
        }
        $this->stateChanged();
    }
874299
public static function remove($key) {
        try {
            self::getCache()->remove($key);
            self::release();
        } catch (\RuntimeException $e) {
            self::release();
            throw $e;
        } catch (\Error $e) {
            self::release();
            throw $e;
        }
    }
982605
static public function purgeUserCacheByUserId( $userId )
    {
        if ( eZINI::instance()->variable( 'RoleSettings', 'EnableCaching' ) === 'true' )
        {
            $cacheFilePath = eZUser::getCacheDir( $userId ). "/user-data-{$userId}.cache.php" ;
            eZClusterFileHandler::instance()->fileDelete( $cacheFilePath );
        }
    }