diff options
author | Marius David Wieschollek <passwords.public@mdns.eu> | 2020-12-02 02:09:25 +0300 |
---|---|---|
committer | Marius David Wieschollek <passwords.public@mdns.eu> | 2020-12-02 02:09:25 +0300 |
commit | 277f5a1571a1a839d4f000a8ef65e35cba5b05ce (patch) | |
tree | fca78bd10526c8b1dc62d51252dd4ca0e26ac6e0 /src/Model/Folder/Folder.js | |
parent | 16ac1f3d221b49b09001bda1d5f1194c5a7cafdd (diff) |
Add model service and support for detail levels
Signed-off-by: Marius David Wieschollek <passwords.public@mdns.eu>
Diffstat (limited to 'src/Model/Folder/Folder.js')
-rw-r--r-- | src/Model/Folder/Folder.js | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/src/Model/Folder/Folder.js b/src/Model/Folder/Folder.js index cac6f17..46c4b76 100644 --- a/src/Model/Folder/Folder.js +++ b/src/Model/Folder/Folder.js @@ -30,16 +30,90 @@ export default class Folder extends AbstractRevisionModel { /** * @return {String} */ + getParentId() { + if(this._properties.hasOwnProperty('parent')) { + return this.getParent().getId(); + } + + return this.getProperty('parentId'); + } + + /** + * @param {String} value + * + * @return {Folder} + */ + setParentId(value) { + if(this._properties.hasOwnProperty('parent')) { + return this.setParent(null); + } + + this.setProperty('parentId', value); + + return this; + } + + /** + * @return {Folder} + */ getParent() { return this.getProperty('parent'); } /** - * @param {String} value + * @param {Folder} value * * @return {Folder} */ setParent(value) { return this.setProperty('parent', value); } + + /** + * @return {(FolderCollection|null)} + */ + getFolders() { + return this.getProperty('folders'); + } + + /** + * @param {(FolderCollection|null)} value + * + * @return {Folder} + */ + setFolders(value) { + return this.setProperty('folders', value); + } + + /** + * @return {(PasswordCollection|null)} + */ + getPasswords() { + return this.getProperty('passwords'); + } + + /** + * @param {(PasswordCollection|null)} value + * + * @return {Folder} + */ + setPasswords(value) { + return this.setProperty('passwords', value); + } + + /** + * @return {(FolderCollection|null)} + */ + getRevisions() { + return this.getProperty('revisions'); + } + + /** + * @param {(FolderCollection|null)} value + * + * @return {Folder} + */ + setRevisions(value) { + return this.setProperty('revisions', value); + } }
\ No newline at end of file |