UserResponse
in package
implements
JsonSerializable
Public-safe user representation (no password_hash, no mfa_secret).
Table of Contents
Interfaces
- JsonSerializable
Properties
- $createdAt : string
- $email : string
- $emailVerified : bool
- $failedLoginAttempts : int
- $id : string
- $isLocked : bool
- $lockedUntil : string|null
- $metadata : mixed
- $mfaEnabled : bool
- $status : UserStatus
- $tenantId : string
- $updatedAt : string
- $username : string
Methods
- __construct() : mixed
- Constructs a UserResponse.
- fromArray() : self
- Rebuilds a UserResponse from one decoded JSON object.
- jsonSerialize() : array<string, mixed>
- Renders this object for `json_encode()`.
- toArray() : array<string, mixed>
- Renders this object back to its wire form.
Properties
$createdAt read-only
public
string
$createdAt
$email read-only
public
string
$email
$emailVerified read-only
public
bool
$emailVerified
$failedLoginAttempts read-only
public
int
$failedLoginAttempts
$id read-only
public
string
$id
$isLocked read-only
public
bool
$isLocked
$lockedUntil read-only
public
string|null
$lockedUntil
= null
$metadata read-only
public
mixed
$metadata
$mfaEnabled read-only
public
bool
$mfaEnabled
$status read-only
public
UserStatus
$status
$tenantId read-only
public
string
$tenantId
$updatedAt read-only
public
string
$updatedAt
$username read-only
public
string
$username
Methods
__construct()
Constructs a UserResponse.
public
__construct(string $createdAt, string $email, bool $emailVerified, int $failedLoginAttempts, string $id, bool $isLocked, mixed $metadata, bool $mfaEnabled, UserStatus $status, string $tenantId, string $updatedAt, string $username[, string|null $lockedUntil = null ]) : mixed
Parameters
- $createdAt : string
-
the server's
created_atfield - $email : string
-
the server's
emailfield - $emailVerified : bool
-
True when the user's email address has been verified (
email_verified_atis set). Exposed for the admin UI / profile. - $failedLoginAttempts : int
-
Number of consecutive failed login attempts.
- $id : string
-
the server's
idfield - $isLocked : bool
-
Whether the account is currently locked (locked_until is in the future).
- $metadata : mixed
-
the server's
metadatafield - $mfaEnabled : bool
-
the server's
mfa_enabledfield - $status : UserStatus
-
the server's
statusfield - $tenantId : string
-
the server's
tenant_idfield - $updatedAt : string
-
the server's
updated_atfield - $username : string
-
the server's
usernamefield - $lockedUntil : string|null = null
-
Timestamp until which the account is locked, if any. (optional)
fromArray()
Rebuilds a UserResponse from one decoded JSON object.
public
static fromArray(array<string, mixed> $data) : self
Parameters
- $data : array<string, mixed>
-
The raw wire object.
Return values
selfjsonSerialize()
Renders this object for `json_encode()`.
public
jsonSerialize() : array<string, mixed>
Any Sensitive it carries stays WRAPPED here, so a log line or a
json_encode($model) in application code prints [SENSITIVE]. The one place a secret
is revealed is ManagementTransport, on the way to the wire
and nowhere else (§27.5).
Return values
array<string, mixed>toArray()
Renders this object back to its wire form.
public
toArray() : array<string, mixed>
§27.4 rule 5: a null property is OMITTED, not emitted as null. On a sparse update those two say opposite things — "leave this alone" versus "set this to nothing" — and only omission means the first.