API / Minn\Content / UserRecord

UserRecord final readonly class

Minn\Content\UserRecord · public/minn/src/Minn/Content/UserRecord.php · 96 lines · implements ArrayAccess

One row of the users table, read by name. Columns keep their WordPress spelling in row(); here they are $user->login, ->email, ->displayName. Array access is the migration bridge, read-only; new code reads the properties.

Constants and properties

propreadonly int $id

Promoted from the constructor.

propreadonly string $login

Promoted from the constructor.

propreadonly string $passwordHash

Promoted from the constructor.

propreadonly string $nicename

Promoted from the constructor.

propreadonly string $email

Promoted from the constructor.

propreadonly string $url

Promoted from the constructor.

propreadonly string $registered

Promoted from the constructor.

propreadonly string $activationKey

Promoted from the constructor.

propreadonly int $status

Promoted from the constructor.

propreadonly string $displayName

Promoted from the constructor.

privatereadonly array $row

Promoted from the constructor.

Public

new__construct(int $id, string $login, string $passwordHash, string $nicename, string $email, string $url, string $registered, string $activationKey, int $status, string $displayName, array $row)#
$rowarray<string, mixed>
staticfromRow(array $row): self#

A record from a users row; a missing column reads as empty.

$rowarray<string, mixed>a users-table row, joined columns welcome
staticfromRows(array $rows): array#

A record for every row, in order.

$rowslist<array<string, mixed>>@return list<self>
methodrow(): array#

The stored row, for the writers and shapers that still spell columns.

The row as the table holds it.

methodname(): string#

The name shown for this person: the display name, or the login when none was set.

methodcolumn(string $name): mixed#

One stored column by its database name, or null.

methodoffsetExists(mixed $offset): bool#

The migration bridge: the record answers to its column names the way the row did.

methodoffsetGet(mixed $offset): mixed#

The migration bridge: one column by its stored name, or null.

methodoffsetSet(mixed $offset, mixed $value): never#

Records are read-only; writes go through the repository.

methodoffsetUnset(mixed $offset): never#

Records are read-only; writes go through the repository.