aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Model/NoteAttachment.php
blob: 9e6a3d3237a160ac1ab4b78579d72f60a4ad616f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
namespace Digitigrade\Model;

use Digitigrade\Model;

class NoteAttachment extends Model {
    public ?int $noteId;
    public int $index;
    public string $type;
    public string $href;
    public ?string $description;

    public function setOwnerId(int $id) {
        $this->noteId = $id;
    }

    protected function getUpdateWhereClause($db): ?string {
        if (self::findWhere('note_id = ? AND index = ?', [$this->noteId, $this->index]) != null) {
            return "note_id = $this->noteId AND index = $this->index";
        }
        return null;
    }
}