API / Minn\Content / Revisions

Revisions final readonly class

Minn\Content\Revisions · public/minn/src/Minn/Content/Revisions.php · 95 lines

Revision rows: the plain snapshots and the per-author autosave slots.

Constants and properties

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\PostWriter $writer

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\PostWriter $writer, Minn\Content\Site $site)#
methodrevisionsOf(int $parentId): array#

The revisions, or the autosaves, of a post, newest first, as rows.

@return list<array> newest first
methodallOf(int $parentId): array#

Every revision of a post, its autosaves among them, newest first by date then id, as rows: what the revisions route lists (probe rest-latest-revision).

methodautosavesOf(int $parentId): array#

The autosaves of a post, newest first, as rows.

methodsaveAutosave(int $parentId, int $userId, string $title, string $content, string $excerpt): int#

One autosave slot per author: updated in place when it exists.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatenamed(int $parentId, string $comparison): array#