Documentation

ToggleUserRole
in package

Table of Contents

Properties

$userRepository  : MySqlUserRepository

Methods

__construct()  : mixed
demote()  : array{success: bool, error?: string}
Demote a user from admin.
promote()  : array{success: bool, error?: string}
Promote a user to admin.

Properties

Methods

demote()

Demote a user from admin.

public demote(int $userId, int $currentAdminId) : array{success: bool, error?: string}
Parameters
$userId : int

The user to demote

$currentAdminId : int

The admin performing the action

Return values
array{success: bool, error?: string}

promote()

Promote a user to admin.

public promote(int $userId, int $currentAdminId) : array{success: bool, error?: string}
Parameters
$userId : int

The user to promote

$currentAdminId : int

The admin performing the action

Return values
array{success: bool, error?: string}

        
On this page

Search results