sub-manager-backend/objects/Title.mjs

31 lines
840 B
JavaScript
Raw Normal View History

2023-09-07 09:39:09 +00:00
import Entity from "./Entity.mjs";
import dataValidation from "./dataValidation.mjs";
2023-09-07 09:39:09 +00:00
//THIS CLASS WILL HANDLE JUNCTION TABLE STUFF
export default class Title extends Entity{
2023-09-07 10:07:34 +00:00
set _title(prop){
if(prop){
if(!dataValidation.isString(prop)){throw new TypeError("title must be a string")}
2023-09-07 10:07:34 +00:00
this.title=prop
2023-09-07 09:39:09 +00:00
}
2023-09-07 10:07:34 +00:00
}
set _genres(prop){
if(prop){
2023-09-18 17:32:12 +00:00
//if(!dataValidation.isObject(prop)){throw new TypeError("genres must be an object")}
2023-09-07 10:07:34 +00:00
this.genres=prop
2023-09-07 09:39:09 +00:00
}
}
2023-09-14 09:40:19 +00:00
set _deleted(prop){
if(prop){
if(prop===1 || prop===0){
this.deleted=prop
}
}
}
2023-09-07 10:07:34 +00:00
constructor(data){
super(data)
this._title = data?.title
this._genres = data?.genres
2023-09-14 09:40:19 +00:00
this._deleted = data?.deleted
2023-09-07 10:07:34 +00:00
}
2023-09-07 09:39:09 +00:00
}