moving from inherited attribute queries to owned one where it makes sense

This commit is contained in:
zadam
2019-12-01 11:10:04 +01:00
parent ba8a8dca7b
commit d9b9d730bb
10 changed files with 26 additions and 37 deletions

View File

@@ -278,6 +278,14 @@ class Note extends Entity {
return await this.getAttributes(LABEL, name);
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), excluding inherited ones
*/
async getOwnedLabels(name) {
return await this.getOwnedAttributes(LABEL, name);
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones
@@ -294,6 +302,14 @@ class Note extends Entity {
return await this.getAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), excluding inherited ones
*/
async getOwnedRelations(name) {
return await this.getOwnedAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise<Note[]>}