diff options
| author | winter | 2025-01-13 20:57:26 +0000 |
|---|---|---|
| committer | winter | 2025-01-13 20:57:26 +0000 |
| commit | 5e5b7c5d6d4bbdd4acaea7d4b6c5be1e27b04a86 (patch) | |
| tree | cb8c66bc1cc02df8e01ee5c8ec18ec74d3dde739 /Digitigrade/Model | |
| parent | f31d2abc237958bd9f33875f20198c4510389556 (diff) | |
make the thread page work
Diffstat (limited to 'Digitigrade/Model')
| -rw-r--r-- | Digitigrade/Model/Note.php | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |
