From 5e5b7c5d6d4bbdd4acaea7d4b6c5be1e27b04a86 Mon Sep 17 00:00:00 2001 From: winter Date: Mon, 13 Jan 2025 20:57:26 +0000 Subject: make the thread page work --- Digitigrade/Model/Note.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Digitigrade') diff --git a/Digitigrade/Model/Note.php b/Digitigrade/Model/Note.php index 6d83a90..277b503 100644 --- a/Digitigrade/Model/Note.php +++ b/Digitigrade/Model/Note.php @@ -111,6 +111,12 @@ class Note extends PushableModel implements TimelineIncludeable { return self::findAllWhere($where, [$author->id], $limit, $offset, 'created DESC'); } + public static function findAllInThread(Note $threadApex, ?int $limit = null, int $offset = 0): array { + $notes = self::findAllWhere('thread_apex = ? AND deleted = false', [$threadApex->id], $limit, $offset, 'created ASC'); + array_splice($notes, 0, 0, [$threadApex]); // since the apex itself has threadApex = null + return $notes; + } + public function getInteractions(): array { return Interaction::findAllWithTarget($this); } -- cgit v1.3