diff options
Diffstat (limited to 'Digitigrade/Model/NoteAttachment.php')
| -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; } |
