2018-03-21 11:13:03 -05:00
|
|
|
<?php
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
class ArticleComment {
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
private $ID;
|
|
|
|
private $Author;
|
|
|
|
private $Content;
|
|
|
|
private $PostDate;
|
|
|
|
private $ArticleID;
|
2024-06-29 08:07:30 -05:00
|
|
|
|
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
public function __construct($id) {
|
|
|
|
$this->ID = $id;
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
$this->getArticleComment($id);
|
|
|
|
}
|
2024-06-29 08:07:30 -05:00
|
|
|
|
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
private function getArticleComment($id) {
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
$db = new DatabaseModule();
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
$getArticle = $db->Handle->prepare('SELECT * FROM ms_articlecomments WHERE id = :id');
|
|
|
|
$getArticle->bindValue(':id', $id, PDO::PARAM_INT);
|
|
|
|
$getArticle->execute();
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
$ArticleInfo = $getArticle->fetch();
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
$getArticle->closeCursor();
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
$this->Author = $ArticleInfo['commentAuthor'];
|
|
|
|
$this->Content = $ArticleInfo['commentContent'];
|
|
|
|
$this->PostDate = betterDate($ArticleInfo['commentDate']);
|
|
|
|
$this->ArticleID = $ArticleInfo['articleID'];
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
}
|
2024-06-29 08:07:30 -05:00
|
|
|
|
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
public function __get($what) {
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
if(property_exists($this, $what)) {
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
return $this->{$what};
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
} else {
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
return null;
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
}
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
}
|
2024-06-29 08:07:30 -05:00
|
|
|
|
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
public function update($what) {
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
}
|
2024-06-29 08:07:30 -05:00
|
|
|
|
2018-03-21 11:13:03 -05:00
|
|
|
}
|
2024-06-29 08:07:30 -05:00
|
|
|
?>
|