API / Minn\Content / TermRecord

TermRecord final readonly class

Minn\Content\TermRecord · public/minn/src/Minn/Content/TermRecord.php · 88 lines · implements ArrayAccess

One term with its taxonomy row, read by name: $term->name, ->slug, ->taxonomy, ->parentId, ->count. The taxonomy and description are empty when the query that built the record did not select them. Array access is the migration bridge, read-only.

Constants and properties

propreadonly int $id

Promoted from the constructor.

propreadonly string $name

Promoted from the constructor.

propreadonly string $slug

Promoted from the constructor.

propreadonly int $taxonomyId

Promoted from the constructor.

propreadonly string $taxonomy

Promoted from the constructor.

propreadonly string $description

Promoted from the constructor.

propreadonly int $parentId

Promoted from the constructor.

propreadonly int $count

Promoted from the constructor.

privatereadonly array $row

Promoted from the constructor.

Public

new__construct(int $id, string $name, string $slug, int $taxonomyId, string $taxonomy, string $description, int $parentId, int $count, array $row)#
$rowarray<string, mixed>
staticfromRow(array $row): self#

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

$rowarray<string, mixed>a terms row joined with term_taxonomy, whatever columns it carries
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.

methodhasParent(): bool#

Whether the term sits under another.

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.