This repository has been archived on 2021-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
Nodezzarella/classes/Article.class.js
2017-07-22 11:35:19 +02:00

86 lines
1.3 KiB
JavaScript

const log = require('color-logs')(true, true, "Article.class.js"),
markdown = require('markdown').markdown,
promise = require('promise');
var id,
title,
author,
content,
date,
img,
slug;
class Article {
constructor(id, title, author, date, img, slug){
this.setId(id);
this.setTitle(title);
this.setAuthor(author);
this.setDate(date);
this.setImg(img);
this.setSlug(slug);
}
setId(id){
this.id = id;
}
setTitle(title){
this.title = title;
}
setAuthor(author){
this.author = author;
}
setContent(content){
this.content = content;
}
setImg(img){
this.img = img;
}
setDate(date){
this.date = date;
}
setSlug(slug){
this.slug = slug;
}
getId(){
return this.id;
}
getTitle(){
return this.title;
}
getAuthor(){
return this.author;
}
getContent(){
return this.content;
}
getDate(){
return this.date;
}
getImg(){
return this.img;
}
getSlug(){
return this.slug;
}
getCompiledContent(){
return markdown.toHTML(this.getContent());
}
}
module.exports = Article;