MS-Tropical/app/classes/EpisodeComment.php

61 lines
877 B
PHP
Raw Normal View History

<?php
2024-06-29 08:07:30 -05:00
class EpisodeComment {
2024-06-29 08:07:30 -05:00
private $ID;
private $Author;
private $Content;
private $PostDate;
private $ShowID;
2024-06-29 08:07:30 -05:00
public function __construct($id) {
$this->ID = $id;
2024-06-29 08:07:30 -05:00
$this->getComment($id);
}
2024-06-29 08:07:30 -05:00
private function getComment($id) {
2024-06-29 08:07:30 -05:00
$db = new DatabaseModule();
2024-06-29 08:07:30 -05:00
$get = $db->Handle->prepare('SELECT * FROM episodecomments WHERE id = :id');
$get->bindValue(':id', $id, PDO::PARAM_INT);
$get->execute();
2024-06-29 08:07:30 -05:00
$data = $get->fetch();
2024-06-29 08:07:30 -05:00
$get->closeCursor();
2024-06-29 08:07:30 -05:00
$this->Author = $data['commentAuthor'];
$this->Content = $data['commentContent'];
$this->PostDate = betterDate($data['commentDate']);
$this->ArticleID = $data['showID'];
2024-06-29 08:07:30 -05:00
}
2024-06-29 08:07:30 -05:00
public function __get($what) {
2024-06-29 08:07:30 -05:00
if(property_exists($this, $what)) {
2024-06-29 08:07:30 -05:00
return $this->{$what};
2024-06-29 08:07:30 -05:00
} else {
2024-06-29 08:07:30 -05:00
return null;
2024-06-29 08:07:30 -05:00
}
2024-06-29 08:07:30 -05:00
}
2024-06-29 08:07:30 -05:00
public function update($what) {
2024-06-29 08:07:30 -05:00
}
2024-06-29 08:07:30 -05:00
}
2024-06-29 08:07:30 -05:00
?>