DBITable
About 1 min
DBITable
Users stored in a database table.
class DBITable implements \Hazaar\Auth\Interface\UserProvider , \Hazaar\Auth\Interface\PasswordStore , \Hazaar\Auth\Interface\UserManager , \Hazaar\Auth\Interface\EmailVerifiableImplements: Hazaar\Auth\Interface\UserProvider, Hazaar\Auth\Interface\PasswordStore, Hazaar\Auth\Interface\UserManager, Hazaar\Auth\Interface\EmailVerifiable
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 |
isEmailVerified
public isEmailVerified(string $identity): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string |
markEmailVerified
public markEmailVerified(string $identity, string $email): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$identity | string | |
$email | string |
emailField
private emailField(string $name): stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | 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 Sun, 08 Nov 2026 03:36:15 +0000