API / Minn\Content / CommentRecord

CommentRecord final readonly class

Minn\Content\CommentRecord · public/minn/src/Minn/Content/CommentRecord.php · 114 lines · implements ArrayAccess

One row of the comments table, read by name: $comment->author, ->content, ->postId, ->parentId, and isApproved() for the status the reference stores as '1'. Array access is the migration bridge, read-only.

Constants and properties

propreadonly int $id

Promoted from the constructor.

propreadonly int $postId

Promoted from the constructor.

propreadonly string $author

Promoted from the constructor.

propreadonly string $authorEmail

Promoted from the constructor.

propreadonly string $authorUrl

Promoted from the constructor.

propreadonly string $authorIp

Promoted from the constructor.

propreadonly string $date

Promoted from the constructor.

propreadonly string $dateGmt

Promoted from the constructor.

propreadonly string $content

Promoted from the constructor.

propreadonly int $karma

Promoted from the constructor.

propreadonly string $approved

Promoted from the constructor.

propreadonly string $agent

Promoted from the constructor.

propreadonly string $type

Promoted from the constructor.

propreadonly int $parentId

Promoted from the constructor.

propreadonly int $userId

Promoted from the constructor.

privatereadonly array $row

Promoted from the constructor.

Public

new__construct(int $id, int $postId, string $author, string $authorEmail, string $authorUrl, string $authorIp, string $date, string $dateGmt, string $content, int $karma, string $approved, string $agent, string $type, int $parentId, int $userId, array $row)#
$rowarray<string, mixed>
staticfromRow(array $row): self#

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

$rowarray<string, mixed>
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.

methodisApproved(): bool#

Approved, and so public.

methodisPending(): bool#

Held for moderation.

methodisComment(): bool#

A plain comment: the type column is '' on old rows and 'comment' on new ones.

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.