User
Less than 1 minute
User
Trait User.
trait UserProvides methods for managing database users, including listing, creating, and dropping users. Intended for use in DBI adapters supporting SQL user operations.
Methods
listUsers
List all users in the database.
public listUsers(): arrayReturns: array
createUser
Create a new user in the database.
public createUser(string $name, ?string $password, array $privileges): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | the name of the user to create |
$password | string | optional password for the user |
$privileges | array | list of privileges to assign to the user |
dropUser
Drop a user from the database.
public dropUser(string $name, bool $ifExists): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | the name of the user to drop |
$ifExists | bool | if true, only drops the user if they exist |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000