opensupports/server/models/Article.php

35 lines
884 B
PHP
Raw Normal View History

<?php
2017-04-21 05:34:20 +02:00
/**
* @api {OBJECT} Article Article
2019-03-06 16:47:24 +01:00
* @apiVersion 4.4.0
2017-04-21 05:34:20 +02:00
* @apiGroup Data Structures
* @apiParam {Number} id Id of the article.
* @apiParam {String} title Title of the article.
* @apiParam {String} content Content of the article.
* @apiParam {Number} lastEdited Last edit of the article.
* @apiParam {Number} position Position of the article.
*/
class Article extends DataStore {
const TABLE = 'article';
public static function getProps() {
return [
'title',
'content',
'lastEdited',
2016-11-23 02:27:05 +01:00
'topic',
'position'
];
}
2016-11-23 02:27:05 +01:00
public function toArray() {
return [
'id' => $this->id,
'title' => $this->title,
'content' => $this->content,
'lastEdited' => $this->lastEdited,
'position' => $this->position
];
}
}