-
Notifications
You must be signed in to change notification settings - Fork 0
API User
Christophe SAUVEUR edited this page Nov 23, 2024
·
3 revisions
class User
User description class
Since 1.0
public function __construct(Services\IAuthenticationService $authenticationService, Services\IDatabaseService $databaseService)
Constructor
Since 2.0
Name | Type | Description |
---|---|---|
$authenticationService |
IAuthenticationService |
Authentication service instance |
$databaseService |
IDatabaseService |
Database service instance |
public function getId(): string|int|null
Gets the current user identifier
Since 2.0
string|int|null
The function returns NULL if no valid user is currently registered
public function isValid(): bool
Gets the current user status.
Since 1.0
boolean
true if the current user is valid, false for guests
public function validateWithFields(array $fields): bool
Validates a user from database fields
Since 2.0
Name | Type | Description |
---|---|---|
$fields |
array |
Database fields used to identify the user |
boolean
true if the user is valid, false either
public function validateWithId(string|int|null $id): bool
Validates the user from its identifier
Since 2.0
Name | Type | Description |
---|---|---|
$id |
`string | int |
boolean
true if the user identifier is valid, false either
Getting Started | Framework Reference | API Reference | MFX is released under the MIT license