aboutsummaryrefslogtreecommitdiffhomepage
path: root/WpfTest/Model/NoteAttachment.php
blob: 16947c54b6ab9a5fc5dc4cbc3850044c9ac38405 (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 WpfTest\Model;

use WpfTest\Model;

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

    protected 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";
        }
        return null;
    }
}