mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
33 lines
832 B
JavaScript
33 lines
832 B
JavaScript
![]() |
"use strict";
|
||
|
|
||
|
const dateUtils = require('../../date_utils.js');
|
||
|
const AbstractEntity = require("./abstract_entity.js");
|
||
|
|
||
|
/**
|
||
|
* Option represents name-value pair, either directly configurable by the user or some system property.
|
||
|
*/
|
||
|
class Option extends AbstractEntity {
|
||
|
static get entityName() { return "options"; }
|
||
|
static get primaryKeyName() { return "name"; }
|
||
|
static get hashedProperties() { return ["name", "value"]; }
|
||
|
|
||
|
constructor(row) {
|
||
|
super();
|
||
|
|
||
|
this.name = row.name;
|
||
|
this.value = row.value;
|
||
|
this.isSynced = !!row.isSynced;
|
||
|
this.utcDateModified = row.utcDateModified;
|
||
|
|
||
|
this.becca.options[this.name] = this;
|
||
|
}
|
||
|
|
||
|
beforeSaving() {
|
||
|
super.beforeSaving();
|
||
|
|
||
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = Option;
|