diff options
| author | winter | 2025-01-28 22:00:20 +0000 |
|---|---|---|
| committer | winter | 2025-01-28 22:00:20 +0000 |
| commit | 093b34db9498d9ce1155c1fd8a59646aa483f85d (patch) | |
| tree | ca596c39d6e001f118b8381cf77d746300add468 /Digitigrade/Model | |
| parent | 1af3a4e00ec63755a90109d8a63a1b6f6d95def6 (diff) | |
add upload/attach file feature for writing notes
Diffstat (limited to 'Digitigrade/Model')
| -rw-r--r-- | Digitigrade/Model/NoteAttachment.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Digitigrade/Model/NoteAttachment.php b/Digitigrade/Model/NoteAttachment.php index 9e6a3d3..1ca0064 100644 --- a/Digitigrade/Model/NoteAttachment.php +++ b/Digitigrade/Model/NoteAttachment.php @@ -10,6 +10,15 @@ class NoteAttachment extends Model { public string $href; public ?string $description; + public static function fromStorageObject(StorageObject $obj, int $index, ?string $description = null) { + $a = new self(); + $a->index = $index; + $a->type = $obj->mimetype; + $a->href = $obj->getUrl(); + $a->description = $description; + return $a; + } + public function setOwnerId(int $id) { $this->noteId = $id; } |
