DBITable
Less than 1 minute
DBITable
Users stored in a database table.
class DBITable implements \Hazaar\Auth\Interface\UserProvider , \Hazaar\Auth\Interface\PasswordStore , \Hazaar\Auth\Interface\UserManagerImplements: Hazaar\Auth\Interface\UserProvider, Hazaar\Auth\Interface\PasswordStore, Hazaar\Auth\Interface\UserManager
The table needs an identity column and a password column (named by fields). The database connection is only opened when a user is first looked up.
Properties
options
private Options $optionsType: Hazaar\Auth\Provider\DBITable\Options
table
public Table $tableType: Hazaar\DBI\Table
dbi
the database to use, instead of the one in $options->dbi
private DBIAdapter $dbiType: Hazaar\DBI\Adapter
Methods
__construct
public __construct(array|Options $options, DBIAdapter $dbi): voidParameters
| Parameter | Type | Description |
|---|---|---|
$options | array | Hazaar\Auth\Provider\DBITable\Options |
$dbi | Hazaar\DBI\Adapter | the database to use, instead of the one in $options->dbi |
findByIdentity
public findByIdentity(string $identity): ?IdentityReturns: Hazaar\Auth\Identity
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
getPasswordHash
public getPasswordHash(string $identity): ?stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
setPasswordHash
public setPasswordHash(string $identity, string $hash): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$hash | string |
createUser
public createUser(string $identity, ?string $passwordHash, array $data): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$passwordHash | string | |
$data | array |
deleteUser
public deleteUser(string $identity): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
find
private find(string $identity): ?arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
table
private table(): TableReturns: Hazaar\DBI\Table
Generated by Hazaar API Doc Generator on Wed, 28 Oct 2026 08:43:30 +0000