diff options
Diffstat (limited to 'Digitigrade/Model/NoteAttachment.php')
| -rw-r--r-- | Digitigrade/Model/NoteAttachment.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Digitigrade/Model/NoteAttachment.php b/Digitigrade/Model/NoteAttachment.php index c47ec64..9e6a3d3 100644 --- a/Digitigrade/Model/NoteAttachment.php +++ b/Digitigrade/Model/NoteAttachment.php @@ -10,13 +10,13 @@ class NoteAttachment extends Model { public string $href; public ?string $description; - protected function setOwnerId(int $id) { + public function setOwnerId(int $id) { $this->noteId = $id; } protected function getUpdateWhereClause($db): ?string { - if (self::findWhere('note_id = ?', [$this->noteId]) != null) { - return "note_id = $this->noteId"; + if (self::findWhere('note_id = ? AND index = ?', [$this->noteId, $this->index]) != null) { + return "note_id = $this->noteId AND index = $this->index"; } return null; } |
