2018-01-29 18:34:59 -05:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const Entity = require('./entity');
|
|
|
|
|
|
|
|
class NoteTree extends Entity {
|
2018-01-29 23:35:36 -05:00
|
|
|
static get tableName() { return "note_tree"; }
|
|
|
|
|
2018-01-29 18:34:59 -05:00
|
|
|
async getNote() {
|
2018-01-29 23:17:44 -05:00
|
|
|
return this.repository.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
|
2018-01-29 18:34:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
async getParentNote() {
|
2018-01-29 23:17:44 -05:00
|
|
|
return this.repository.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND parentNoteId = ?", [this.parentNoteId]);
|
2018-01-29 18:34:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = NoteTree;
|