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
| prop | readonly int $id | Promoted from the constructor. |
| prop | readonly int $postId | Promoted from the constructor. |
| prop | readonly string $author | Promoted from the constructor. |
| prop | readonly string $authorEmail | Promoted from the constructor. |
| prop | readonly string $authorUrl | Promoted from the constructor. |
| prop | readonly string $authorIp | Promoted from the constructor. |
| prop | readonly string $date | Promoted from the constructor. |
| prop | readonly string $dateGmt | Promoted from the constructor. |
| prop | readonly string $content | Promoted from the constructor. |
| prop | readonly int $karma | Promoted from the constructor. |
| prop | readonly string $approved | Promoted from the constructor. |
| prop | readonly string $agent | Promoted from the constructor. |
| prop | readonly string $type | Promoted from the constructor. |
| prop | readonly int $parentId | Promoted from the constructor. |
| prop | readonly int $userId | Promoted from the constructor. |
| private | readonly 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)# |
| |||
| static | fromRow(array $row): self# | A record from a comments row; a missing column reads as empty.
| |||
| static | fromRows(array $rows): array# | A record for every row, in order.
| |||
| method | row(): array# | The stored row, for the writers and shapers that still spell columns. | |||
| method | isApproved(): bool# | Approved, and so public. | |||
| method | isPending(): bool# | Held for moderation. | |||
| method | isComment(): bool# | A plain comment: the type column is '' on old rows and 'comment' on new ones. | |||
| method | column(string $name): mixed# | One stored column by its database name, or null. | |||
| method | offsetExists(mixed $offset): bool# | The migration bridge: the record answers to its column names the way the row did. | |||
| method | offsetGet(mixed $offset): mixed# | The migration bridge: one column by its stored name, or null. | |||
| method | offsetSet(mixed $offset, mixed $value): never# | Records are read-only; writes go through the repository. | |||
| method | offsetUnset(mixed $offset): never# | Records are read-only; writes go through the repository. |
Nothing matches.