UpdateUser
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- execute() : array{success: bool, errors?: string[]}
- Update an existing user.
Properties
$passwordHasher
private
PasswordHasher
$passwordHasher
$userRepository
private
UserRepositoryInterface
$userRepository
Methods
__construct()
public
__construct(UserRepositoryInterface $userRepository, PasswordHasher $passwordHasher) : mixed
Parameters
- $userRepository : UserRepositoryInterface
- $passwordHasher : PasswordHasher
execute()
Update an existing user.
public
execute(int $userId, int $currentAdminId, string $username, string $email[, string $password = '' ][, string $role = User::ROLE_USER ][, bool $isActive = true ]) : array{success: bool, errors?: string[]}
Parameters
- $userId : int
-
The user ID to update
- $currentAdminId : int
-
The ID of the admin performing the update
- $username : string
-
New username
- $email : string
-
New email
- $password : string = ''
-
New password (empty to skip)
- $role : string = User::ROLE_USER
-
New role
- $isActive : bool = true
-
New active status