diff options
| author | winter | 2024-12-23 19:48:28 +0000 |
|---|---|---|
| committer | winter | 2024-12-23 19:48:28 +0000 |
| commit | 505d25e29f1c13403bfbfe7cd9d1ab125be87a4b (patch) | |
| tree | 1f2e914b3aacd57defb84acf78a871ad1f896927 /Digitigrade/Model/Note.php | |
| parent | bccad1118364427ea5c97c08d132fd128368760b (diff) | |
make the timelines look nicer and add local tl
Diffstat (limited to 'Digitigrade/Model/Note.php')
| -rw-r--r-- | Digitigrade/Model/Note.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Digitigrade/Model/Note.php b/Digitigrade/Model/Note.php index 9d73a89..8dbec90 100644 --- a/Digitigrade/Model/Note.php +++ b/Digitigrade/Model/Note.php @@ -124,6 +124,15 @@ class Note extends PushableModel { return array_unique($instances); } + /** + * Gets this note's formatted content in the given mimetype or null if there isn't one + * @param string $mimetype content type to return + * @return ?string the marked up content + */ + public function getFormattedContent(string $mimetype): ?string { + return array_filter($this->formattedContent, fn($item) => $item['mimetype'] == $mimetype)[0]['body'] ?? null; + } + public function jsonSerialize(): array { if ($this->deleted) { return [ |
