diff options
Diffstat (limited to 'Digitigrade')
| -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); } |
